Question-165:What is JDBC?
Answer:
JDBC is a Java API that is used to connect and execute query to the database. JDBC API uses jdbc drivers to connects to the database.
Question-166: What is JDBC Driver?
Answer:
JDBC Driver is a software component that enables java application to interact with the database.There are 4 types of JDBC drivers:
JDBC-ODBC bridge driver
Native-API driver (partially java driver) Network Protocol driver (fully java driver) Thin driver (fully java driver).
Question-167: What are the steps to connect to database in java?
Answer:
Question-165: What is the difference between Statement and PreparedStatement interface?
Answer:
In case of Statement, query is complied each time whereas in case of PreparedStatement, query is complied only once. So performance of PreparedStatement is better than Statement.
Question-169: How can we execute stored procedures and functions?
Answer:
By using Callable statement interface, we can execute procedures and functions.
Question-170: How can we store and retrieve images from the database?
Answer:
By using PreparedStaement interface, we can store and retrieve images.
Answer:
JDBC is a Java API that is used to connect and execute query to the database. JDBC API uses jdbc drivers to connects to the database.
Question-166: What is JDBC Driver?
Answer:
JDBC Driver is a software component that enables java application to interact with the database.There are 4 types of JDBC drivers:
JDBC-ODBC bridge driver
Native-API driver (partially java driver) Network Protocol driver (fully java driver) Thin driver (fully java driver).
Question-167: What are the steps to connect to database in java?
Answer:
- Register the driver class
- Creating connection
- Creating statement
- Executing queries
- Closing connection.
Question-165: What is the difference between Statement and PreparedStatement interface?
Answer:
In case of Statement, query is complied each time whereas in case of PreparedStatement, query is complied only once. So performance of PreparedStatement is better than Statement.
Question-169: How can we execute stored procedures and functions?
Answer:
By using Callable statement interface, we can execute procedures and functions.
Question-170: How can we store and retrieve images from the database?
Answer:
By using PreparedStaement interface, we can store and retrieve images.
No comments:
Post a Comment