below is the code snip.
// First create the metadata representation of a pool
// this is usually created automatically using poolman.xml
// but here we do it programmatically:
JDBCPoolMetaData meta = new JDBCPoolMetaData();
// set attributes programmatically
meta.setDbname("mydatabase");
meta.setDriver("oracle.jdbc.OracleDriver");
meta.setURL("jdbc:oracle:thin:@192.1.1.191:1521:orcl");
meta.setUserName("scott");
meta.setPassword("tiger");
meta.setJNDIName("mydatabase");
meta.setMaximumSize(20);
// set any other desired attributes available in poolman.xml
// now create the pool using that metadata
JDBCPool newPool = new JDBCPool(meta);
//SQLManager.addPool(newPool);
SQLManager.getInstance().addPool(newPool.getPoolname(),newPool);
// The new pool is now available
//then I want to get the connection from poolman
Connection con =
DriverManager.getConnection("jdbc:poolman://mydatabase");//I am not
certain this sentence is right!
2002年4月28日 02时07分53秒 CST:
mydatabase received null value for log file, using System.out
2002年4月28日 02时07分54秒 CST:
PoolMan JDBCPool unable to locate a default JNDI provider, mydatabase
DataSource not bound to JNDI: null
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at com.juyee.test.PoolManUnitTest.main(PoolManUnitTest.java:37)
who can help me?
thanks.