JDBC INTERVIEW QUESTIONS
1. What is JDBC?
JDBC means Java DataBase Connectivity which is used to connect to a database and execute queries in the database.
JDBC means Java DataBase Connectivity which is used to connect to a database and execute queries in the database.
2. What is JDBC
Driver?
JDBC Driver is a software component that enables the java application to connect to a database. There are 4 types of JDBC Drivers. They are:
JDBC Driver is a software component that enables the java application to connect to a database. There are 4 types of JDBC Drivers. They are:
1. JDBC ODBC Bridge
2. Native API partly
Java Driver
3. Net Pure Java
Driver
4. Pure Java Driver
or Thin Driver
3. How many information
are required to connect to a database?
To connect to a database, we should require 4 information. They are
To connect to a database, we should require 4 information. They are
1. Driver Class Name
2. URL
3. Username of the
database
4. Password of the
database
4. Which package we
have to import to connect to a database?
In Java program, we have to import java.sql package.
In Java program, we have to import java.sql package.
5. What are the
interfaces present in java.sql package?
We have the following interfaces present in java.sql package. They are:
We have the following interfaces present in java.sql package. They are:
1. Connection
2. Statement
3. PreparedStatement
4. CallableStatement
5. ResultSet
6. ResultSetMetaData
7. DatabaseMetaData
6. What are the
classes present in java.sql package?
We have the following classes present in java.sql package. They are:
We have the following classes present in java.sql package. They are:
1. DriverManager
2. SQLException
3. SQLWarning
7. What
is DriverManager? DriverManager is a class in java.sql package. It is the basic service for managing a set of JDBC drivers.