J
JGH
What's the "right" way to write a batch script in java?
I've written an object that allows me to get data from a database. I can
use this object via jsp. Now I want to write a script that will be run
nightly via a cron job.
Say, for example, I have an object that allows me to
insert/update/delete records from an Oracle table. I want to open a text
file and import those rrecords into the Oracle table.
In perl, I'd include the code for the object via a "use" statement. But
in java, do I have to create another class to extend the class that
does the actual work? And then, perhaps, in cron I'd put:
0 0 * * * /usr/local/bin/java import.class
I just want to make sure I'm doing it "right". The above cron entry
seems kind of strange. I'd rather say:
0 0 * * * /home/inventory/import
And in /home/inventory/import
#!/usr/local/bin/java
[java code here]
But maybe I'm just thinking in perl.
I've written an object that allows me to get data from a database. I can
use this object via jsp. Now I want to write a script that will be run
nightly via a cron job.
Say, for example, I have an object that allows me to
insert/update/delete records from an Oracle table. I want to open a text
file and import those rrecords into the Oracle table.
In perl, I'd include the code for the object via a "use" statement. But
in java, do I have to create another class to extend the class that
does the actual work? And then, perhaps, in cron I'd put:
0 0 * * * /usr/local/bin/java import.class
I just want to make sure I'm doing it "right". The above cron entry
seems kind of strange. I'd rather say:
0 0 * * * /home/inventory/import
And in /home/inventory/import
#!/usr/local/bin/java
[java code here]
But maybe I'm just thinking in perl.