cancel
Showing results for 
Search instead for 
Did you mean: 

jConnect + SQL Anywhere 16

Former Member
0 Kudos

Hi all.

I am trying to connect a Java application to SQL Anywhere 16 using jConnect driver, but when I try to stablish connection y receive the following error:

java.sql.SQLException: JZ0SJ: Metadata accessor information was not found on this database. Please install the required tables as mentioned in the

jConnect documentation.


Which tables a required? I have read there are some .sql files that shoub be executed in data base in order to make jconnec works, where can i find those .sql files?


With a previous version of SQL Anythere everything worked, so I suppose there is something that must be configured or installed in the new version.


Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member207653
Active Participant
0 Kudos

DocCommentXchange

because that error message mentions database metadata, have a look at the link above please

Former Member
0 Kudos

I tried that, but It did not work.

former_member207653
Active Participant
0 Kudos

http://service.sap.com/sap/support/notes/1935412

please read the KBA above and double check you have done the same

Former Member
0 Kudos

Sorry, but that link calls for authentication and I do not have credentials for that.

former_member207653
Active Participant
0 Kudos

Symptom

•The SAP SQL Anywhere database is compatible with the jConnect JDBC driver (which is a Type-4 JDBC driver, and uses the Tabular Data Stream (TDS) protocol for communications). However, some JDBC functionality in jConnect (related to accessing the database metadata class java.sql.DatabaseMetaData) when using SQL Anywhere is only enabled after installing the jConnect metadata database functions into the database file.
•When connecting or using certain JDBC functions, you receive the error or exception:

       SQLException: JZ0SJ: Metadata accessor information was not found on this database. Please install the required tables as mentioned in the jConnect documentation.

•The method to install the jConnect metadata functions changed in SQL Anywhere 11 from previous versions. How do you install the database jConnect metadata support in these newer versions of SQL Anywhere?
•Where is the "\scripts\jcatalog.sql" jConnect metadata installation file located and why is the "-j" switch for the Initialization Utility (dbinit) in SQL Anywhere 11 (and higher) no longer documented?


Environment

•SAP SQL Anywhere 16
SAP SQL Anywhere 12
SAP SQL Anywhere 11
•All supported platforms
•SAP jConnect JDBC Driver


Cause

•The method to install the jConnect metadata functions has changed in SQL Anywhere 11.
•The older script file 'jcatalog.sql' is now embedded in the dbscript11.dll file.


Resolution

•The jConnect metadata functions are now always installed into the database by default, at initialization time.
CREATE DATABASE 'database.db';
dbinit database.db

•If you need to prevent the installation of the jConnect metatdata functions during initialization / upgrade, use the Initialization Utility (dbinit) -i / Upgrade Utility (dbupgrad) -i switch, or specify 'JCONNECT OFF' in the "CREATE DATABASE" SQL statement:
CREATE DATABASE 'database.db' JCONNECT OFF;
dbinit -i database.db

dbupgrad -i -c "uid=dba;pwd=sql;dbf=database.db"

•If you are getting the error "SQLException: JZ0SJ: Metadata accessor information was not found on this database. Please install the required tables as mentioned in the jConnect documentation.", you need to install the jConnect system objects.

To upgrade an existing database to install the current jConnect metadata functions (or to enable the functions on a database that did not previously have them), use the "ALTER DATABASE UPGRADE JCONNECT" SQL statement or the Upgrade Utility (dbupgrad).
ALTER DATABASE UPGRADE JCONNECT ON;
dbupgrad -c "uid=dba;pwd=sql;dbf=database.db"

•The "-j" option for the Initialization Utility (dbinit) is now ignored in SQL Anywhere 11 and above.