You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Paul Tomsic <pt...@yahoo.com> on 2002/12/12 20:14:08 UTC

dbcp - dataSource.getConnection only fails from within tomcat

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
ol(null);
ObjectPool connectionPool = new
GenericObjectPool(null);
ConnectionFactory connectionFactory = new
DriverManagerConnectionFactory("jdbc:mysql://10.117.7.18:3306/dow?autoReconnect=true",
"user", "pwd");
PoolableConnectionFactory poolableConnectionFactory =
new PoolableConnectionFactory(connectionFactory,
connectionPool, null, null, false, true);
PoolingDataSource dataSource = new
PoolingDataSource(connectionPool);
// nullpointerexception on the next line
conn = dataSource.getConnection();


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com