NEED help connecting to database using JAVAS ERVICE

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

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.

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

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

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

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

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

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

Thanks

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