Can I use the following piece of JAVA code to create JDBC connection in webMethods. We are trying to create connections and perform other insert operations without using webMethods JDBC Adapter. If yes, what are the advantages and disadvantages???
Can I bind JDBC Adapter connection created using webMethods Admin to a JNDI name…The main purpose is to the existing code…we will reading all the values from abc.properties file…
In abc.properties file registry.datasource=db2/abc (This is the JNDI name which we should bind to our JDBC Connection Pool (in webMethods)…
InitialContext initialcontext = new InitialContext();
String dataSourceName getTokenFromabcProperties(“registry.datasource”).trim();
logger.debug(“DatasourceName is :” + dataSourceName);
DataSource datasource = (DataSource)initialcontext.lookup(dataSourceName);
logger.debug(“Got datasource! Trying connection.”);
conn = datasource.getConnection();
logger.debug(“Got connection from datasource.”);
I can say we cannot use JDBCAdapterConnection Name = JNDI Name…I did a test and it didn’t worked…can any one tell me how JDBC Adapter maintaines connection pool information etc???
If we use the code given below…it will not maintain connection pools information…its rather a direct call to JDBC which is not advisable…I was wondering is their a way to use webMethods JDBC Connection pool (created by webMethods, when we create JDBC Adapter Connection) in java code (not webMethods provided JAVA API).
WmDB allows the creation of “data sources” and even the use of your own driver. I have used this a number of times. Unfortunatly I have had to use the data sources indirectly from my Java classes through invoking webMethods services. Layers upon layers.
I need to quickly adapt a set of servlets that use JNDI managed DataSource objects. It is probably futile to expect I can make a simple adaption. I cannot quickly set-up JBoss (it seems to kill LDAP for authentication and users/group mgt in my installation). I cannot quickly upgrade to IS 6.5 or 6.1 - I am stuck with 6.0.1 and WmTomcat.
How can we create Data Source(Connetion pool) using wmDB package ?.
Kevin,
Any solution you got for this problem.
I too am facing the same problem.I need to execute a set of direct SQL statements(the set may contain insert/update statements to multiple tables). There is no such kind of service in JDBC Adapter.which support batch insertion of direct SQL statements into multiple tables.
Sourabh,
I too am thinking of using our own connection pools.As you said you implemented this how was the performance and all.Is it OK?
As far as I can tell it is not possible. If the WmDB package uses the DataSource interface I cannot tell. It is not exposed either way.
I solved my problem by not using WmDB at all.
We use i-net Opta2000 driver here. I wrapped the PoolManager that comes with this driver API. Knocked up a service to maintain a config file to simplify post deployment data source configuration. Not so neat but such is life.