JDBC Interview Q
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?
- java.sql
- javax.sql
- What are the steps to develop a JDBC Program?
- Register the JDBC Driver.
- Establish the Connection with Database Server.
- Create a Statement object to send SQL query to the DB server.
- Send the query to the DB server with the help of Statement object.
- 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