Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unanswered: 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.


  2. #2
    Join Date
    Apr 2003
    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.)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts