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.