The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.


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.


asked 31 Aug '11, 04:48

Gabriel's gravatar image

accept rate: 50%

edited 15 Mar '13, 21:35

Mark%20Culp's gravatar image

Mark Culp

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.

JDBC applications

  • The Java component of the SQL Anywhere JDBC 4.0 driver is included in the sajdbc4.jar file ( Type 2 JDBC drivers) installed into the Java subdirectory of your SQL Anywhere installation.

  • jconn3.jar (Type 4 JDBC driver) is located in the classes subdirectory of your jConnect 6.0.5 installation

In conclusion, there is no JDBC driver for SQL Anywhere which support the paramMetaData.

permanent link

answered 19 Sep '11, 04:42

Gabriel's gravatar image

accept rate: 50%

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:

permanent link

answered 08 Sep '11, 13:38

Ian%20McHardy's gravatar image

Ian McHardy
accept rate: 38%

Have you installed the jConnect Metadata system objects on your v12 database yet?


permanent link

answered 31 Aug '11, 17:19

Jeff%20Albion's gravatar image

Jeff Albion
accept rate: 24%

Thank you for the answer.

I run the sample database named demo.db:
C:\Users\Public\Documents\SQL Anywhere 12\Samples\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:
con = DriverManager.getConnection("jdbc:sybase:Tds:", "DBA", "sql");
PreparedStatement pstmt = con.prepareStatement("SELECT ID, GivenName, Surname FROM Customers");
ParameterMetaData paramMetaData = pstmt.getParameterMetaData();
if (paramMetaData == null)
System.out.println("ERROR: db vendor does NOT support ParameterMetaData");
System.out.println("SUCCEED: ParameterMetaData is supported");

You may try on the same sample database with this command:
java -cp .;jconn3.jar JDBCConnect jconnect > output.log

permanent link

answered 01 Sep '11, 08:53

Gabriel's gravatar image

accept rate: 50%

I agree; it seems that this object returns null in this use-case from my experiments as well.

It should be noted that the ParameterMetaData call is not mandatory or standardized for JDBC 3.0 implementations (See: ), hence the structure of the code samples you have seen elsewhere.

(07 Sep '11, 15:25) Jeff Albion
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 31 Aug '11, 04:48

question was seen: 3,277 times

last updated: 15 Mar '13, 21:35