I would connect a java application via the JDBC driver jconn3.jar to my database SQL Anywhere v12. Unfortunatly, I discovered that the method named getParameterMetaData returns null.
PreparedStatement pstmt = con.prepareStatement(MY_QUERY); ParameterMetaData paramMetaData = pstmt.getParameterMetaData();
paramMetaData -> null
The JDBC driver named jconn3.jar is it valid ? Is there a workaround?
Thank you for your answer.
Thanks for all your answers. I reorganized my project. Thus, I don't need anymore a JDBC 4.0 driver to connect myself to a SQL Anywhere database. I have asked the Sybase support about the JDBC drivers and here is their answer:
I confirm you that jconn3.jar from jConnect 6.0.5 is a Type 4 JDBC driver.
The JDBC specification identifies four types of JDBC drivers, from the Type 1 "JDBC-ODBC bridge" to the Type 4 "pure Java" driver. SQL Anywhere includes JDBC 3.0 and 4.0 drivers, which are Type 2 JDBC drivers, and also supports the jConnect driver for pure Java applications, which is a Type 4 JDBC driver.
In conclusion, there is no JDBC driver for SQL Anywhere which support the paramMetaData.
answered 19 Sep '11, 04:42
I'm not a JDBC expert, but I know we typically recommend the SQL Anywhere JDBC driver over the JConnect driver I believe you are using. I'm not sure if the SQL Anywhere JDBC driver specifically implements the ParamaterMetaData call you are trying to use, but it is likely worth a try. See "SQL Anywhere JDBC Driver" in the documentation, for example:
answered 08 Sep '11, 13:38
Thank you for the answer.
I run the sample database named demo.db:
I executed the Upgrade Database Wizard. Despite the wizard told me that the jconnect support is already installed in my database, I finished the upgrade. It still not works. Then, I executed the query you have mentionned in the tool named "Interactive SQL". And sadly, I'm still not able to get a ParameterMetaData.
Here is the java code I run:
You may try on the same sample database with this command:
answered 01 Sep '11, 08:53