Access database metadata
To access information about the HCL Informix® database, use the JDBC API DatabaseMetaData interface.
Informix® JDBC Driver implements all the JDBC 3.0 specifications for DatabaseMetaData methods.
- getSuperTypes()
- getSuperTables()
- getAttributes()
- getResultSetHoldability()
- getDatabaseMajorVersion()
- getDatabaseMinorVersion()
- getJDBCMajorVersion()
- getJDBCMinorVersion()
- getSQLStateType()
- locatorsUpdateCopy()
- supportsGetGeneratedKeys()
- supportsMultipleOpenResults()
- supportsNamedParameters()
- supportsGetGeneratedKeys()
- supportsMultipleOpenResults()
- The JDBC application programmer provides an SQL statement to be executed.
- The server executes the SQL statement and an indication that autogenerated keys can be retrieved is returned.
- Before the server executes the SQL statement, columnNames or columnIndexes (if provided) are validated. An SQLException is thrown if they are invalid.
- If requested, the JDBC driver and server returns a resultSet object. If no keys were generated, the resultSet is empty, containing no rows or columns.
- The user can request metadata for the resultSet object, and the JDBC driver and server returns a resultSetMetaData Object.
For more information about retrieving autogenerated keys, see the JDBC 3.0 Specification, Section 13.6, Retrieving Auto Generated Keys.
Informix® JDBC Driver uses the sysmaster database to get database metadata. If you want to use the DatabaseMetaData interface in your Java™ program, the sysmaster database must exist in the Informix® database server to which your Java™ program is connected.
Informix® JDBC Driver interprets the JDBC API term schemas to mean the names of Informix® users who own tables. The DatabaseMetaData.getSchemas() method returns all the users found in the owner column of the systables system catalog.
Similarly, Informix® JDBC Driver interprets the JDBC API term catalogs to mean the names of Informix® databases. The DatabaseMetaData.getCatalogs() method returns the names of all the databases that currently exist in the Informix® database server to which your Java™ program is connected.
The example DBMetaData.java shows how to use the DatabaseMetaData and ResultSetMetaData interfaces to gather information about a new procedure. Refer to Sample code files for more information about this example.