This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Error with PostgreSQL and setQueryTimeout

Jun 27th, 2009, 08:13 AM

Hi all,

I'm using Spring's JdbcTemplate (through JdbcDaoSupport) to do some operations on a table. I'm using Spring 2.5.6.SEC01 and c3p0 0.9.1.2 (and Hibernate 3.3.1.GA, but it's not involved in this example).

When I run my code with a MySQL 5.0 back-end and mysql-connector-java 5.1.7 as a JDBC driver, everything works smoothly.

However, when I switch to PostgreSQL 8.3 with postgresql 8.3-603.jdbc3 or 8.3-603.jdbc4 driver, I get the following exception:

It's basically complaining that the function setQueryTimeout(int) is not implemented for this driver... However, I recall having worked with Spring and PostgreSQL before, and I've never encountered this. Could someone shed some light?