Java Reference
In-Depth Information
32.24
What is DatabaseMetaData for? Describe the methods in DatabaseMetaData .
How do you get an instance of DatabaseMetaData ?
Check
Point
32.25
What is ResultSetMetaData for? Describe the methods in ResultSetMetaData .
How do you get an instance of ResultSetMetaData ?
32.26
How do you find the number of columns in a result set? How do you find the column
names in a result set?
K EY T ERMS
candidate key
1177
integrity constraint
1176
database system
1174
primary key 1177
relational database 1177
Structured Query Language (SQL)
domain constraint
1177
foreign key 1177
foreign key constraint
1178
1177
superkey
1177
C HAPTER S UMMARY
1.
This chapter introduced the concepts of database systems , relational databases ,
relational data models , data integrity , and SQL . You learned how to develop database
applications using Java.
2.
The Java API for developing Java database applications is called JDBC . JDBC provides
Java programmers with a uniform interface for accessing and manipulating relational
databases.
3.
The JDBC API consists of classes and interfaces for establishing connections with data-
bases, sending SQL statements to databases, processing the results of SQL statements,
and obtaining database metadata.
4.
Since a JDBC driver serves as the interface to facilitate communications between JDBC
and a proprietary database, JDBC drivers are database specific. A JDBC-ODBC bridge
driver is included in JDK to support Java programs that access databases through ODBC
drivers. If you use a driver other than the JDBC-ODBC bridge driver, make sure it is in
the classpath before running the program.
5.
Four key interfaces are needed to develop any database application using Java: Driver ,
Connection , Statement , and ResultSet . These interfaces define a framework for
generic SQL database access. The JDBC driver vendors provide implementation for them.
6. A JDBC application loads an appropriate driver using the Driver interface, connects
to the database using the Connection interface, creates and executes SQL statements
using the Statement interface, and processes the result using the ResultSet interface
if the statements return results.
7. The PreparedStatement interface is designed to execute dynamic SQL statements
with parameters. These SQL statements are precompiled for efficient use when
repeatedly executed.
8.
Database metadata is information that describes the database itself. JDBC provides
the DatabaseMetaData interface for obtaining database-wide information and the
ResultSetMetaData interface for obtaining information on the specific ResultSet .
 
 
Search WWH ::




Custom Search