Connection conn = null;
Context ctx = new InitialContext();
DataSource newDataSource = (DataSource) ctx.lookup(LoadPropertie.getInstance().getProperty("JNDINAME"));
conn = newDataSource.getConnection();
return conn;
JDNINAME是在.properties文件中定义的连接池串
Context ctx = new InitialContext();
DataSource newDataSource = (DataSource) ctx.lookup(LoadPropertie.getInstance().getProperty("JNDINAME"));
conn = newDataSource.getConnection();
return conn;
JDNINAME是在.properties文件中定义的连接池串
http://jakarta.apache.org/commons/dbcp/DbConnectionBroker
http://www.javaexchange.com/
如果是实用,自己编是不合适的
jive喝tomcat的都有吧