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_server.sql installs stored procedures on Adaptive Server databases of versions earlier than 12.0.
sql_server12.sql installs stored procedures on Adaptive Server databases of version 12.0.x.
sql_server12.5.sql installs stored procedures on Adaptive Server datsabases of version 12.5.x.
sql_server15.0.sql installs stored procedures for Adaptive Server 15.0 through 15.5.
sql_server15.7.sql installs stored procedures for Adaptive Server 15.7 or later.2
sql_server15.7.0.2.sql installs stored procedures for Adaptive Server 15.7 ESD #2 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
sql_asa12.sql – installs stored procedures on the SQL Anywhere 12.x database
The most recent versions of these scripts are 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.