commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Tomsic <>
Subject dbcp - dataSource.getConnection only fails from within tomcat
Date Thu, 12 Dec 2002 19:14:08 GMT
could someone guess as to why I can connect to our DB
(MySQL) from a standalone application (single, java
file using a Main()) successfully using the below
code, but when I try to do it from within Tomcat, it
fails w/ a nullpointer?

thanks - 

GenericObjectPool connectionPool = new GenericObjectPo
ObjectPool connectionPool = new
ConnectionFactory connectionFactory = new
"user", "pwd");
PoolableConnectionFactory poolableConnectionFactory =
new PoolableConnectionFactory(connectionFactory,
connectionPool, null, null, false, true);
PoolingDataSource dataSource = new
// nullpointerexception on the next line
conn = dataSource.getConnection();

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

View raw message