Posted By:
joe_user
Posted On:
Sunday, May 23, 2004 02:09 AM
For Oracle, I have a script that looks like this (to start the database).
---- cut ----
$ORACLE_HOME/bin/lsnrctl start
$ORACLE_HOME/bin/sqlplus "/as sysdba" << __EOF
startup;
exit;
__EOF
---- cut ----
The important part is the sqlplus thing, the '<< __EOF __EOF' surrounds the commands to be executed by sqlplus after its invocation. This is UNIX rather than java, though.
Perhaps mysql allows a similar construct.
What I'd really do in a situation like yours, is to detach the sql part from my program (seems that you want to do general purpose stuff) and stick it into a web services or other process.