JDBC Interview Questions and Answers - Part 2

Java packages - java.sql: java.sql is an API to access and process the data stored in a database, typically a relational database using the java...
How to open a database connection using JDBC - Opening a database connection: The database connection should be established after registering the drivers. The getConnection is used to open a database connection. The following code snippet illustrates this:...
JDBC : How to send SQL statements to databases for execution? - The following illustrates with examples, to send SQL statements to databases for execution:...
What is a “dirty read”? - In typical database transactions, one transaction reads changes the value while the other reads the value before committing or rolling back by the first transaction...
JDBC - Cold backup, hot backup, and warm backup recovery - Cold backup is a recovery technique, in which the files must be backed up before the database is restarted at the same time...
What is 2 phase commit? - Distributed transactions are performed by relational databases...
JDBC Resultset Types - Resultset contains results of the SQL query. There are 3 basic types of resultset...
JDBC Isolation levels - Transaction Isolation levels is used to implement locking. They decide how one process isolated from other is. We have four ...
JDBC Optimistic and Pessimistic locking - There are two kinds of locking available in JDBC.Optimistic Locking, Pessimistic Locking...
JDBC - No suitable driver - Failure to load the appropriate JDBC driver before giving a call to DriverManager.getConnection method causes ‘No Suitable Driver’ error...
JDBC Bridge - The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls made to ODBC. The concurrent access...
JDBC SQL Locator - DBMS uses the logical pointers as identifiers to locate and manipulate the data. A Locator is an SQL3 data-type...
JDBC Optimistic Concurrency Control - In optimistic concurrency control, locks are granted without performing conflict checks. In this, a track of files which have been read...
JDBC Pessimistic Concurrency - In this approach, each transaction is assigned a timestamp. One can make sure that they are unique...
The URLs need to be converted to strings as there is no single universal protocol to treat the URLs...
JDBC objects - Connections, Statements and ResultSets generate SQLWarnings through getWarnings method...
JDBC Updatable ResultSet - For the results to be updatable, the Statement object used to create the result sets must have the concurrency type ResultSet.CONCUR_UPDATABLE...
Insert an image file - Upload all raw data-types (like binary documents) to the database as an array of bytes (bytes[]). Then you can,..
PreparedStatement - What is PreparedStatement?, What is the advantage of using a Prepared Statement?, difference between Statement and Prepared Statement...
TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE - Constant indicating that the type for a ResultSet object is scrollable but not sensitive to changes made by others...
JDBC RowSet Types - Connected: A connected RowSet Object is permanent in nature. It doesn’t terminate until the application is terminated...
JDBC ResultSet - How can you retrieve data from the ResultSet?, What are the various means of accessing results from ResultSet objects?...
JDBC Non-repeatable Read - A Non-repeatable read is where one transaction cannot read the second time unless another transaction alters the row...
JDBC Advantages- Provide Existing Enterprise Data, Simplified Enterprise Development, Zero Configuration for Network Computers, Full Access to Metadata...
JDBC drivers - When you have loaded a driver, it is available for making a connection with a DBMS...
JDBC Driver Types - JDBC Net pure Java driver(Type IV) is the fastest driver because it converts the jdbc calls to network protocol used by DBMS Server...
JDBC Isolation Levels - The values are defined in the class java.sql.Connection and are: ...
A stored procedure is invoked by using CallableStatement object. It also requires an open Connection object...