Results 1 to 5 of 5

Thread: db2 utils

  1. #1
    Join Date
    Feb 2005
    Posts
    118

    Unanswered: db2 utils

    is it possible to call db2 (ver 7.2 on windows) utilities such as LOAD from java code ? if yes, how ?

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    For export and import you have C APIs ... You can call them using JNI .. Refer the manual Adminstrative APIs for more information on these APIS

    From V8, LOAD also has an API ...


    The other alternative is to invoke a command line from the Java code ...

    Cheers
    Sathyaram
    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Feb 2005
    Posts
    118
    invoking the command line from java sounds like an option. Is there any code I can use to show our developers.

    thanks.
    Anil

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    This is used extensively
    http://www.devdaily.com/java/edu/pj/...pj010016.shtml
    gives a basic java example ..

    Instead of ps -ef, you may use (this is a ksh example)
    db2_export.ksh sample1 table1.ixf ixf "select * from table1"

    where the db2_export.ksh script will be
    #/bin/ksh
    #
    #
    db2 connect to $1
    db2 export to $2 of $3 $4 with ur
    db2 terminate

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Here is an example from IBM on how to use the command line from java:

    http://www.developer.ibm.com/tech/sampdb2.html

    Look at the runstats one in particular.

    Andy

Posting Permissions

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