Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

JDBC%20Interview%20Questions%20and%20Answers

Question: What is JDBC? Describe the steps needed to execute a SQL query using JDBC.
Answer: We can connect to databases from java using JDBC. It stands for Java DataBase Connectivity.
Here are the steps:
  1. Register the jdbc driver with the driver manager
  2. Establish jdbc connection
  3. Execute an sql statement
  4. Process the results
  5. Close the connection
Before doing these do import java.sql.*

JDBC is java based API for accessing data from the relational databases. JDBC provides a set of classes and interfaces for doing various database operations. The steps are:
  • Register/load the jdbc driver with the driver manager.
  • Establish the connection thru DriverManager.getConnection();
  • Fire a SQL thru conn.executeStatement();
  • Fetch the results in a result set.
  • Process the results.
  • Close statement/result set and connection object.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook