What is JDBC? Answer:
JDBC stands for Java Database Connectivity.
JDBC is a layer of abstraction that allows users to choose between databases.
It allows you to change to a different database engine and to write to a single API. JDBC allows you to write database applications in Java
without having to concern yourself with the underlying details of a particular database.
What are the two major components of JDBC? Answer:
One implementation interface for database manufacturers,
the other implementation interface for application and applet writers.
What is JDBC Driver interface? Answer:
The JDBC Driver interface provides vendor-specific implementations of the abstract classes provided by the JDBC API.
Each vendors driver must provide implementations of the
What are the common tasks of JDBC? Answer:
Create an instance of a JDBC driver or load JDBC drivers through jdbc.drivers
Register a driver
Specify a database
Open a database connection
Submit a query
How to use JDBC to connect to Microsoft Access? Answer:
There are two techniques available for connecting to a data source using JDBC.
First, if your program will talk to an ODBC data source, you can use the JDBC-ODBC bridge included with your JDK.
In the case of Sun, you would use sun.jdbc.odbc.JbdcOdbcDriver.
Specifically, using Class.forName:
or the command line:
java -Djdbc.drivers=sun.jdbc.odbc.JdbcOdbcDriver < program name >
Second, you can connect to your data source through a third-party, vendor-specific bridge.
In the case of a third party driver, you simply substitute that driver for the JDBC-ODBC bridge driver.
What are four types of JDBC driver? Answer:
Type 1 Drivers
Bridge drivers such as the jdbc-odbc bridge.
They rely on an intermediary such as ODBC to transfer the SQL calls to the database and also often rely on native code.
Type 2 Drivers
Use the existing database API to communicate with the database on the client.
Faster than Type 1, but need native code and require additional permissions to work in an applet. Good for client-side connection.
Type 3 Drivers : Java Protocol
Call the database API on the server. Type 3 JDBC drivers translate queries into JDBC-formatted statements, which are then converted to the
format required by the DBMS.
Pure Java and no native code.
Type 4 Drivers
The hightest level of driver reimplements the database network API in Java. No native code.
What packages are used by JDBC? Answer:
There are at least 8 packages:
There are three basic types of SQL statements, what are they? Answer:
What are the flow statements of JDBC? Answer:
A URL string -->getConnection-->DriverManager-->Driver-->Connection-->
What are the steps involved in establishing a connection?
This involves two steps: