db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny" <danny.gallag...@gainergroup.com>
Subject RE: running ij from the command line
Date Fri, 13 Jan 2006 13:30:24 GMT
I finally figured out all the pieces of the command:

java -cp derby.jar;derbytools.jar -Dderby.system.home=C:/DerbyDB/
-Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver
-Dij.protocol=jdbc:derby:
-Dij.database=wiredb;user=wireapp;password=eeeeeeeeeee
org.apache.derby.tools.ij < fullbanks.sql >out.txt

By setting derby.system.home, ij.protocol and ij.database works great now,

So I was able to figure out which 2 records out of 120,000 were not being
inserted and the reason for it.

Thanks for the help.

Danny Gallagher
The Gainer Group
6525 The Corners Parkway
Suite 215
Norcross Ga, 30092
 
 
-----Original Message-----
From: Stanley Bradbury [mailto:Stan.Bradbury@gmail.com] 
Sent: Thursday, January 12, 2006 11:52 PM
To: Derby Discussion
Subject: Re: running ij from the command line

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