JDBC Interview Q

  • What is JDBC?
JDBC is an API(Application Programming Interface) used to develop a java program that communicates with any DataBase server without changing the code.
  • Can we use C program to communicate with Database?
Yes, we can use C program to communicate with database, but it is able to communicate with only one database.

  • What are CI functions? What is their use?
Every database contains its own CI(Call Interface) functions.
  • What are the two most important packages of JDBC API?
  1. java.sql 
  2. javax.sql
  • What are the steps to develop a JDBC Program?
  1. Register the JDBC Driver.
  2. Establish the Connection with Database Server.
  3. Create a Statement object to send SQL query to the DB server.
  4. Send the query to the DB server with the help of Statement object.
  5. Close the Connection.
  • What is the difference between Statement and Prepared Statement?
A statement is parsed and executed each time when it is submitted to database, where as a Prepared Statement is parsed once and executed repeatedly with different parameters.
  • What are Positional parameters? How are they represented?
Positional Parameters are the parameters that are passed to the Prepared Statement. They are represented by "?".





No comments:

Post a Comment