To support JDBC DatabaseMetaData methods, Sybase provides a set of stored procedures that jConnect can call for metadata about a database. These stored procedures must be installed on the server for the JDBC metadata methods to work.
If the stored procedures for providing metadata are not already installed in a Sybase server, you can install them using stored procedure scripts provided with jConnect:
sql_server12.sql installs stored procedures on Adaptive Server databases version 12.0.x.
sql_server12.5.sql installs stored procedures on Adaptive Server databases of version 12.5 and later.
sql_server15.0.sql installs stored procedures for Adaptive Server 15.x or later.
sql_asa.sql – installs stored procedures on the SQL Anywhere 9.x database
sql_asa10.sql – installs stored procedures on the SQL Anywhere 10.x database
sql_asa11.sql – installs stored procedures on the SQL Anywhere 11.x database
The most recent version of these scripts is compatible
with all versions of jConnect.
See the Sybase jConnect for JDBC Installation Guide and Sybase jConnect for JDBC Release Bulletin for complete instructions on installing stored procedures.
In addition, to use the metadata methods, you must set the USE_METADATA connection property to true (its default value) when you establish a connection.
You cannot get metadata about temporary tables in a database.
The DatabaseMetaData.getPrimaryKeys method
finds primary keys declared in a table definition (CREATE
TABLE) or with alter table (ALTER TABLE ADD CONSTRAINT).
It does not find keys defined using sp_primarykey.