![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Using a Connection from a Connection PoolTo use a connection from a connection pool in your client application:
The following simple example opens a connection to BEA WebLogic, sets up a Properties object, and then opens a series of connections from the eng connection pool created in a previous example. Class.forName("COM.cloudscape.core.WebLogicDriver").newInstance(); // Set the weblogic.t3.connectionPoolID to specify // the connection pool to use the connection from; // specify userName and passwd for this connection. // Properties tengahProps = new Properties(); tengahProps.put("weblogic.t3.connectionPoolID", "eng"); tengahProps.put("user", "fred"); tengahProps.put("password", "fredPasswd"); Connection conn = DriverManager.getConnection( "jdbc:cloudscape:weblogic://localhost:7001"+ "&weblogic.t3.cacheRows=0", tengahProps); // Do some database work // Release the connection conn.close(); Note that the client releases the JDBC connection and returns it to the pool before disconnecting. When the JDBC connection is returned to the connection pool, all outstanding JDBC transactions are rolled back and closed. | ||
![]() ![]() ![]() ![]() ![]() ![]() | ![]() ![]() Cloudscape Version 3.0 ![]() For technical support, go to: www.cloudscape.com and click Support. Copyright © 1998 and 1999 Cloudscape, Inc. All rights reserved. |