JDBC Interview Questions and Answers - by Sivareddy
JDBC Interview Questions and Answers - by Sivareddy
-By SivaReddy
1) What is JDBC?
java.sql (Provides the API for accessing and processing data stored in a data source
(usually a relational database) using the Java TM programming language), The
JDBC 4.0 API
2) What are different types of drivers available to connect to database?
Type 1(JDBC-ODBC Bridge Driver)
Type 2(JDBC API calls are converted into native C/C++ API calls)
Type 3 (The JDBC clients use standard network sockets to communicate with a middleware
application server)
Type 4(Pure Java-based driver communicates directly with the vendor's database through
socket connection)
3) Steps involved in working with JDBC?
Load the Driver Class
Establishing a connection.
Create a statement.
Execute the query.
Process the ResultSet object.
Close the connection.
4) What is Statement and different types of Statements available to work JDBC?
Statement
PreparedStatement
CallableStatement
5) What is resultSet and resultset Types, Result Concurrency?
TYPE_FORWARD_ONLY
TYPE_SCROLL_INSENSITIVE
TYPE_SCROLL_SENSITIVE
CONCUR_READ_ONLY: The ResultSet object cannot be updated using
the ResultSet interface.
CONCUR_UPDATABLE: The ResultSet object can be updated using the ResultSet interface.