Using JDBC to Create Database Objects
By James W. Cooper2003-05-24
DatabaseMetaData
The DatabaseMetaData object gives you information about the entire database. You use it primarily to get the names of the tables in a database and the names of the columns in a table. Since various databases also support different variants of SQL, there are also a large number of methods querying the database about what SQL methods it supports.
| getCatalogs() | Return a list of catalogs of information in that database. With the JDBC-ODBC Bridge driver, you get a list of databases registered with ODBC. This is seldom used in JDBC-ODBC databases. |
| getTables(catalog, schema, tableNames, columnNames) | Returns a description of the table names for all tables matching tableNames and all columns matching columnNames. |
| getColumns(catalog, schema, tableNames, columnNames) | Returns a description of the table column names for all tables matching tableNames and all columns matching columnNames. |
| getURL(); | Get the name of the URL you are connected to. |
| getDriverName(); | Get the name of the database driver you are connected to. |
Tutorial Pages:
» What is a Database?
» Getting Data out of Databases
» Kinds of Databases
» ODBC
» What Is JDBC?
» Installing and Using JDBC
» Types of JDBC Drivers
» Two-Tier and Three-Tier Models
» Writing JDBC Code to Access Databases
» Registering Your Database with ODBC
» Connecting to a Database
» Accessing the Database
» The ResultSet
» ResultSetMetaData
» DatabaseMetaData
» Getting Information on Tables
» Executing SQL Queries, Printing out ResultSets, A Simple JDBC Program
» Building Higher Level JDBC Objects
» Building a Database Object, A Visual Database Program
» Executing a Query
» The Query Result Dialog
» Example Files
» Summary
First published by IBM DeveloperWorks
