Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2014
    Posts
    294

    Unanswered: Multiple connections on db2luw

    Hi,

    I am struggling with something like to open multiple connections to a db2 sever at a time . Maximum of 3 connections to be run.
    I tried with ATS but have to run on a federation database & finally ended up with a bug.
    Can some one kindly give me a small basic code like an db2luw external procedure or function to open 2 connections on a db2 server.
    I can't use any sql file to open the connection as the database name & procedure call statements are dynamic.
    I got tired to find out the solution for this.

    I am not completely into Db2 so unable to get the complete concepts in it.
    I am using db2 c express on windows.

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    External UDFs & SPs shouldn't establish additional connections to db2 databases.
    Have you tried to learn the java examples provided here:
    ...\SQLLIB\samples\java\jdbc
    ?

    You can try to run scripts with CLPPLUS utility as well.
    It has a number of significant advantages over DB2 CLP.
    Regards,
    Mark.

  3. #3
    Join Date
    Jul 2014
    Posts
    294
    Hi Mark,

    Thanks for the reply.
    I tried to find some external routines examples from the location you mentioned. There is no such kind of examples.

    Can you kindly provide me a small code snippet to call a bat file from a db2 java procedure. I tried in many ways as I am having zero knowledge on java, not able to achieve.

    I am using windows with db2 c express.

    It would be a great help for me .

    Thanks a lot

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Maybe you should state what you are trying to do and why. You might actually get a workable solution.

    It is not a good idea to execute code outside the database from within.

    Andy

  5. #5
    Join Date
    Jul 2014
    Posts
    294
    Thanks for the reply ARWinner.
    Actually I am having 100 tables each having 30 records. I can update these 100 tables one by one on a direct call in a procedure, As the control has to pass table by table serially, which is taking more time.
    My requirement is how can i run at-least three update statements at a time concurrently.For example I have to start updating table1 & without waiting to get completed I have to start updating table2.

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    That has to be done at the application layer. Nothing in DB2 will let you do that.

    Andy

  7. #7
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    If you don't have the SQLLIB\samples catalog, then it means that you didn't checked the corresponding option during db2 installing. You may try to install an additional db2 express-c copy for that.
    If you have zero knowledge on java, it's worth to start learning from the following examples: SpServer.java, SpClient.java
    Regards,
    Mark.

Tags for this Thread

Posting Permissions

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