If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > problem running db2 script from a Java Program

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-19-04, 19:08
globetrotcom globetrotcom is offline
Registered User
 
Join Date: Jan 2004
Posts: 23
problem running db2 script from a Java Program

I am trying to run a table-populating db2 script from a Java program. But the program is hanging. This java program is already being used, successfully, to create tables etc. That means, it already has a connection to the database.

The script runs successfully outside the java program. When run outside the Java program, the db2 script "connect to DBNAME" before it loads the table.

Thinking that this "connect to ..." might interfere with script operation from within program, I removed this "connect to ..." statement, but the script still hangs.

java statement that invokes this script is:

Runtime.getRuntime().exec("db2cmd -c -w -i db2 -c -t -v -f script.sql")

I'd appreciate any help.

Thanks
Reply With Quote
  #2 (permalink)  
Old 01-20-04, 00:03
brat4 brat4 is offline
Registered User
 
Join Date: Apr 2003
Location: Singapore
Posts: 59
maybe u need to give full path to the sql file. (Please dont forget the escape charater is "\" so ur path needs to be modified appropriately.)

HTH
brat
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On