Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

jdbc 2 pool size

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,
Back in the JDBC 1.0 days, you write your own pool and you can do what ever you want. With the JDBC2.0 everything is done for you, but I can't see to find any methods on setting pool size.
BTW. My current project dose not deal with J2EE, so all the EJB stuff doesn't really apply.
For example here is a code segment. What do I do if I want the max pool size to be 30?
import oracle.jdbc.driver.*;
import oracle.jdbc.pool.*;
/**
* Makes a connection to the database
*/
public class ConnectionManager {
private static ConnectionManager instance = new ConnectionManager();
Connection connection = null;
OracleConnectionPoolDataSource ocpds = null;
PooledConnection pc = null;
String tdbStr = "jdbc:oracle:thin:@myServer:1973:blah1";
private ConnectionManager()
{
try {
// Create a OracleConnectionPoolDataSource instance
ocpds = new OracleConnectionPoolDataSource();
ocpds.setURL( tdbStr ); // Set connection parameters
ocpds.setUser("myUserName");
ocpds.setPassword("myPassword");

pc = ocpds.getPooledConnection(); // Create a pooled connection

connection = pc.getConnection(); // Get a Logical connection
}
catch (java.sql.SQLException e) {
e.printStackTrace();
System.exit (-1) ;
}
}
public static ConnectionManager getInstance() {
return instance;
}
public Connection getConnection() {
return connection;
}
}

Thanks
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic