Discussion Locked

Web Logic

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to connect to the database using the commonpool thro the servlet it is giving an error saying that this service may not be done with the server.I running in weblogic server.Could any one tell me how to solve this.

5 replies

by ravi303

It is necessary to create a pool first in the weblogic properties file for example.....
weblogic.jdbc.connectionPool.myPool= url=jdbc:weblogic:mssqlserver4, driver=weblogic.jdbc.mssqlserver4.Driver, loginDelaySecs=1, initialCapacity=1, maxCapacity=2, capacityIncrement=1, allowShrinking=true, shrinkPeriodMins=15, refreshMinutes=10, testTable=someCreatedTable, props=user=sa;password=;server=Odyssey@RAVIN

this creates a pool say'myPool'
now we get the connection using this pool by
the following code.

Properties props = new Properties();
props.put("user", "system");
props.put("password", "yourpass");
Driver myDriver = (Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection conn = myDriver.connect("jdbc:weblogic:pool:myPool", props);

and now we can return 'conn'

which is the connection.

by ravi303

It is necessary to create a pool first in the weblogic properties file for example.....
weblogic.jdbc.connectionPool.myPool= url=jdbc:weblogic:mssqlserver4, driver=weblogic.jdbc.mssqlserver4.Driver, loginDelaySecs=1, initialCapacity=1, maxCapacity=2, capacityIncrement=1, allowShrinking=true, shrinkPeriodMins=15, refreshMinutes=10, testTable=someCreatedTable, props=user=sa;password=;server=Odyssey@RAVIN

this creates a pool say'myPool'
now we get the connection using this pool by
the following code.

Properties props = new Properties();
props.put("user", "system");
props.put("password", "yourpass");
Driver myDriver = (Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection conn = myDriver.connect("jdbc:weblogic:pool:myPool", props);

and now we can return 'conn'

which is the connection.

This discussion is closed to new replies.