I have a java application from which I need to delete and insert data into a local JDBC derby database. I’m trying to execute a SQL script that does this using the ij utility. I’ve written a batch file to handle this.
C:
C:\Progra~1\Sun\JavaDB\bin\ij.bat
connect 'jdbc:derby:D:\Documents and Settings\user\My Documents\mydatabase';
run "D:\Documents and Settings\user\sqlscript.sql";
disconnect;
exit;
When I run the batch file, the command prompt will execute up to line 2. The ij utility will load in the command prompt, but then the rest of the commands won’t be run. I’ve tested each line by hand and it works fine (as does the SQL script). Is there anything I need to add to the batch file to make the last 4 lines execute? Thanks.
Put these commands in a file called ‘commands.txt’
then run ij as follows from your batch file:
You might have the add the exact path to to commands.txt if it is not in your current folder.