1. What is the JDBC?Java Database Connectivity (JDBC) is a standard Java API to interact with relational databases form Java. JDBC has set of classes and interfaces which can use from Java application and talk to database without learning RDBMS details and using Database Specific JDBC Drivers. 2. What are the new features added to JDBC 4.0?The major features added in JDBC 4.0 include :
3. Explain Basic Steps in writing a Java program using JDBC?JDBC makes the interaction with RDBMS simple and intuitive. When a Java application needs to access database :
4. Exaplain the JDBC Architecture.
Figure 1: JDBC Architecture
![]() ![]() The JDBC Architecture consists of two layers:
The JDBC API uses a driver manager and database-specific drivers to provide transparent connectivity to heterogeneous databases. The JDBC driver manager ensures that the correct driver is used to access each data source. The driver manager is capable of supporting multiple concurrent drivers connected to multiple heterogeneous databases. The location of the driver manager with respect to the JDBC drivers and the Java application is shown in Figure 1. 5. How do I load a database driver with JDBC 4.0 / Java 6?Provided the JAR file containing the driver is properly configured, just place the JAR file in the classpath. Java developers NO longer need to explicitly load JDBC drivers using code like Class.forName() to register a JDBC driver.The DriverManager class takes care of this by automatically locating a suitable driver when the DriverManager.getConnection() method is called. This feature is backward-compatible, so no changes are needed to the existing JDBC code. 6. What is JDBC Driver interface?The JDBC Driver interface provides vendor-specific implementations of the abstract classes provided by the JDBC API. Each vendor driver must provide implementations of the java.sql.Connection,Statement,PreparedStatement, CallableStatement, ResultSet and Driver. 7. What does the connection object represents?The connection object represents communication context, i.e., all communication with database is through connection object only. 8. What is Statement ?Statement acts like a vehicle through which SQL commands can be sent. Through the connection object we create statement kind of objects. Through the connection object we create statement kind of objects. Statement stmt = conn.createStatement();
This method returns object which implements statement interface. 9. What are callable statements ?Callable statements are used from JDBC application to invoke stored procedures and functions. |