• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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

 
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!
 
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".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!