DB programming Flashcards
WHat does programming with a database require
-A database server and its connection information
-A programming language writing code to query the database
-A library or driver for connecting to the particular database system
General process for programming with a database
1) Load the database access library
2) Create a connection to the database
3) Execute a SQL command
4) Retrieve database results produced by the command
5) Close the database connection
Java interface
Abstract class consisting of a set of methods with no implementation
How to create a JDBC driver
DBMS vendor must implement the interfaces by defining their own classes and writing the code for the methods in the interface
The main interfaces in the JDBC API are:
Driver - The main class of the entire driver
Connection - For connecting to the DB using the driver
Statement - For executing a query using a connection
ResultSet - For storing and manipulating results returned by a Statement.
DatabaseMetaData - For retrieving metadata (schema) information from a database.