Skip to main content

vertica jdbc Connection.isValid() method is not working

  • September 12, 2013
  • 5 replies
  • 23 views

raj_ch
  • Participating Frequently
I am creating jdbc connection as below Class.forName("com.vertica.jdbc.Driver"); Connection con = DriverManager.getConnection( url, properties); the connection is good, I could run sqls and get results back. But when I do con.isValid(30); on the connection, it throws java.lang.AbstractMethodError exception. version: vertica-jdk5-6.0.1-0.jar db version: Vertica Analytic Database v6.1.2-0 Note: con.isClosed() is not suitable for our need.

5 replies

Prasanta_Pal
Forum|alt.badge.img
  • Participating Frequently
  • September 12, 2013
Try con.isValid(0); if value is greater than 0 is a bug, fix would be available in version 7 and above.

raj_ch
  • Author
  • Participating Frequently
  • September 12, 2013
Thanks for the help Prasanta. I am happy using 0, but 1> What is the operation vertica jdbc is doing to check the health of the connection. 2> Does it takes indefinite amount of time to complete. 3> We need to really consider the cases of connection being killed/not closed properly/dead/busy to check this case. Please suggest me. The JDBC api doc says... timeout - - The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires before the operation completes, this method returns false. A value of 0 indicates a timeout is not applied to the database operation.

raj_ch
  • Author
  • Participating Frequently
  • September 13, 2013
I tested with 0 and I got the same java.lang.AbstractMethodError exception.

Prasanta_Pal
Forum|alt.badge.img
  • Participating Frequently
  • September 14, 2013
Can you try installing the latest client drivers compatible with Vertica 6.1.2, it looks like you are using older version of the client? The version should be vertica-jdk5-6.1.2-0.jar

raj_ch
  • Author
  • Participating Frequently
  • September 18, 2013
I updated jar to vertica-jdk5-6.1.2-0.jar and I see the same result.