IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

NEED help connecting to database using JAVAS ERVICE

  • 1.  NEED help connecting to database using JAVAS ERVICE

    Posted Tue July 12, 2005 04:16 PM

    Hi everyBody,
    i was looking into the previous post regarding how to send a wmDb connection Alias into a Java service to connect to Database


    I believe you are using WmDB package for connecting to a DB using “dbAlias” configuration in the ISAdminConsole/WmDB.
    So here is the code snippet of the JavaService that you are looking for.
    Pass the “dbAlias” as a input to the javaservice from a flowservice.This dbAlias acts as a dbConnection.

    import java.util.;
    import java.sql.
    ;
    import oracle.jdbc.driver.*
    IDataCursor inputCursor = pipeline.getCursor();
    inputCursor.first(“dbAlias”);
    dbAlias = (String) inputCursor.getValue();
    ConnectionManager connMgr = ConnectionManager.getInstance();
    //replaceInsert(inputCursor,“Message 1:”, “ConnectionManager object obtained.” + connMgr);
    Connection conn = connMgr.getNamedConnection(dbAlias);

    HTH,
    RMG.


    I am having the same scenario but i am connecting to DB2 is there any connectionManager class that is there to connect to DB2 using WMDB alias Name.

    Tnanks in advance


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Mon March 27, 2006 11:29 AM

    RMG
    Pls advice how to use a connectionManager class in the java code. I tried using the above code snippet but it does not worked. I am using webMethods 4.6 and JDK1.3 is installed.
    Also, will that be able to handle connection Pooling?
    Plz help.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Mon March 27, 2006 03:00 PM

    What error are you getting?
    yes i believe using WMDB alias you should able to connect to DB2.

    May be this link is helpful to you regarding connection/configuration to DB2 [url]wmusers.com

    HTH
    RMG


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Mon March 27, 2006 03:49 PM

    Thanks RMG for such a prompt reply but our database is Oracle 9i.
    Can you pls tell us the workaround for that too.
    The problem is to have connection pooling in java service(using DBAlias)
    Plz reply it is urgent.

    Thanks in Advance


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Mon March 27, 2006 05:19 PM

    Perhaps we covered this in other threads, but why are you doing this in Java?


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Tue March 28, 2006 05:09 AM

    Thanks for replying
    The reason for using a java servce.
    I am using Integration Server(IS) 4.6.1 version Jdk1.3 installed
    I have a java service that uses a JDBC thin driver to make a call to an Oracle DB stored procedure. The stored procedure takes as an input a variable array so the java service declares the variable of the type oracle.sql.ArrayDescriptor & oracle.sql.ARRAY. The above task cannot be accomplished thr’ the flow service pub.db.call so a java service was written for the same.
    I saw in the earlier posts that through Connection manager class we can use the DBaliases to make connection to DB which will also use the IS connection pooling in that case.
    Also we are facing lot of performance issues like delay in inserting the data to the target system in our load testing. So thinking to have connection pooling to address the same.
    Pls let me know how to achieve the same. I searched the Wm forumn but do not get this problem addressed in any of the threads.

    Thanks & Regards


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 7.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Tue March 28, 2006 09:16 AM

    Hi RMG

    Its becoming very urgent for us, hence asking for your suggestions again

    We are unable to find ‘ConnectionManager’ & corresponding method u r suggesting to use : getNamedConnection
    I have searched in all the packages like import java.util.;
    import java.sql.
    ;
    import oracle.jdbc.driver.*
    But unable to find
    please let us know under which package we can find this class

    Regards


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 8.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Fri April 07, 2006 04:10 PM

    RMG,
    Pls help. We are still looking for an answer.

    Thanks


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: NEED help connecting to database using JAVAS ERVICE

    Posted Fri April 07, 2006 04:58 PM

    Hi,
    Try importing java.sql.DriverManager, java.sql.Connection. I use those to connect to oracle
    Regards,
    Pradeep


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB