Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Anoukhan Hout
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic