vertica jdbc Connection.isValid() method is not working

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.

Comments

  • Prasanta_PalPrasanta_Pal - Select Field - Employee
    Try con.isValid(0); if value is greater than 0 is a bug, fix would be available in version 7 and above.
  • 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.
  • I tested with 0 and I got the same java.lang.AbstractMethodError exception.
  • Prasanta_PalPrasanta_Pal - Select Field - Employee
    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
  • I updated jar to vertica-jdk5-6.1.2-0.jar and I see the same result.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file