db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: running ij from the command line
Date Fri, 13 Jan 2006 04:51:54 GMT
Danny wrote:

>I am trying to capture the output of a very large number of inserts
>(120,000) records.  I need the output to go to a file.
>
>I cannot seem to get the command right:
>
>If I use:
>java -cp derby.jar;derbytools.jar
>-Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver
>org.apache.derby.tools.ij < fullbanks.sql > out.txt
>
>* the jars, sql and txt files all reside in the directory that I run 
>  this command from.
>
>I get:
>ij version 10.0
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>ij> IJ ERROR: Unable to establish connection
>etc....
>
>the first two lines in fullbanks.sql are:
>connect 'jdbc:derby:C:/DerbyDB/wiredb;user=wireapp;password=ddddd';
>AUTOCOMMIT ON;
>
>but they don't seem to get executed or something?
>
>If I instead use:
>java -cp derby.jar;derbytools.jar
>-Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver
>org.apache.derby.tools.ij 
>
>I get into ij and then the connect command works.
>However, I don't think I can capture the output once I am already in ij.
>
>Any help is greatly appreciated.
>
>Danny Gallagher
>The Gainer Group
>6525 The Corners Parkway
>Suite 215
>Norcross Ga, 30092
> 
> 
>
>
>
>  
>

You don't need the input redirect, IJ automatically reads the input 
filename as an argument from the command line.  This is the command I 
use in a script on a regular basis (the input file is myScript.sql):

 java -Dij.protocol=jdbc:derby:  -Dij.database=myDB 
org.apache.derby.tools.ij  myScript.sql   >> scriptOutput.log


Mime
View raw message