File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC Exception:  Cannot create PoolableConnectionFactory (validationQuery didn't return a row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Exception:  Cannot create PoolableConnectionFactory (validationQuery didn Watch "JDBC Exception:  Cannot create PoolableConnectionFactory (validationQuery didn New topic
Author

JDBC Exception: Cannot create PoolableConnectionFactory (validationQuery didn't return a row

Anoukhan Hout
Greenhorn

Joined: Mar 16, 2012
Posts: 1
Hello,

While everything was working, and also on my local test machine, I am getting an exception:



The connexion is set in context.xml that is given here:




The query call looks like this:




Note that I tried a classical Java connexion with the same parameters and it works fine.

Any ideas? I have checked all I could and I still have no clue...

Thanks in advance!
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Is that the entire Resource element that you provided?

The error suggests that you have specified a value for the validationQuery attribute, but it's not returning any rows from the DB; when you do specify a validationQuery, you must ensure that it will return at least one row: http://commons.apache.org/dbcp/configuration.html

Alternatively, don't specify or comment out your validationQuery attribute. Here's an example of how this attribute can be used: http://wiki.apache.org/commons/DBCP
For instance for Oracle I would use something like "select 1 from dual".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Exception: Cannot create PoolableConnectionFactory (validationQuery didn't return a row