General discussion

Locked

Web Logic

By vvasant ·
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.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Web Logic

by ravi303 In reply to Web Logic

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.

Collapse -

Web Logic

by vvasant In reply to Web Logic

The question was auto-closed by TechRepublic

Collapse -

Web Logic

by ravi303 In reply to Web Logic

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.

Collapse -

Web Logic

by vvasant In reply to Web Logic

The question was auto-closed by TechRepublic

Collapse -

Web Logic

by vvasant In reply to Web Logic

This question was auto closed due to inactivity

Back to IT Employment Forum
5 total posts (Page 1 of 1)  

General Discussion Forums