InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 201. |
What's The Jdbc 3.0 Api? |
|
Answer» The JDBC 3.0 API is the latest update of the JDBC API. It CONTAINS MANY features, including scrollable result sets and the SQL:1999 DATA types. JDBC (Java Database Connectivity) is the standard for communication between a Java application and a relational database. The JDBC API is released in two versions; JDBC version 1.22 (released with JDK 1.1.X in package java.sql) and version 2.0 (released with Java platform 2 in packages java.sql and javax.sql). It is a SIMPLE and powerful largely database-independent way of extracting and INSERTING data to or from any database. The JDBC 3.0 API is the latest update of the JDBC API. It contains many features, including scrollable result sets and the SQL:1999 data types. JDBC (Java Database Connectivity) is the standard for communication between a Java application and a relational database. The JDBC API is released in two versions; JDBC version 1.22 (released with JDK 1.1.X in package java.sql) and version 2.0 (released with Java platform 2 in packages java.sql and javax.sql). It is a simple and powerful largely database-independent way of extracting and inserting data to or from any database. |
|
| 202. |
What Is Connection Pooling? What Is The Main Advantage Of Using Connection Pooling? |
|
Answer» A connection POOL is a mechanism to REUSE connections created. Connection pooling can increase performance dramatically by REUSING connections rather than creating a new PHYSICAL connection each time a connection is REQUESTED. A connection pool is a mechanism to reuse connections created. Connection pooling can increase performance dramatically by reusing connections rather than creating a new physical connection each time a connection is requested. |
|
| 203. |
What Is A Datasource? |
|
Answer» A DATASOURCE object is the REPRESENTATION of a data SOURCE in the Java programming language. In basic terms,
A DataSource object is the representation of a data source in the Java programming language. In basic terms, |
|
| 204. |
What Is The Need Of Batchupdates? |
|
Answer» The BatchUpdates feature allows US to group SQL statements together and send to database SERVER in one SINGLE TRIP. The BatchUpdates feature allows us to group SQL statements together and send to database server in one single trip. |
|
| 205. |
What Are The Different Types Of Rowset ? |
|
Answer» There are two types of RowSet are there. They are:
There are two types of RowSet are there. They are: |
|
| 206. |
What Is Rowset? |
|
Answer» A RowSet is an object that encapsulates a set of rows from either Java Database Connectivity (JDBC) result sets or tabular DATA sources like a file or spreadsheet. RowSets support component-based DEVELOPMENT models like JavaBeans, with a STANDARD set of properties and an EVENT notification . A RowSet is an object that encapsulates a set of rows from either Java Database Connectivity (JDBC) result sets or tabular data sources like a file or spreadsheet. RowSets support component-based development models like JavaBeans, with a standard set of properties and an event notification . |
|
| 207. |
What Is Resultset ? |
|
Answer» The ResultSet REPRESENTS set of rows RETRIEVED due to QUERY execution. ResultSet rs = stmt.executeQuery(SQLQUERY);The ResultSet represents set of rows retrieved due to query execution. |
|
| 208. |
What Are The Standard Isolation Levels Defined By Jdbc? |
|
Answer» The VALUES are DEFINED in the CLASS java.sql.Connection and are:
Any GIVEN database may not support all of these levels. The values are defined in the class java.sql.Connection and are: Any given database may not support all of these levels. |
|
| 209. |
Which Is The Right Type Of Driver To Use And When? |
| Answer» | |
| 210. |
Which Type Of Jdbc Driver Is The Fastest One? |
|
Answer» JDBC Net pure Java driver(Type IV) is the FASTEST driver because it converts the JDBC calls into vendor SPECIFIC protocol calls and it DIRECTLY interacts with the database. JDBC Net pure Java driver(Type IV) is the fastest driver because it converts the JDBC calls into vendor specific protocol calls and it directly interacts with the database. |
|
| 211. |
What Are Types Of Jdbc Drivers? |
|
Answer» There are four types of drivers defined by JDBC as follows:
There are four types of drivers defined by JDBC as follows:
|
|
| 212. |
How To Call A Stored Procedure From Jdbc ? |
|
Answer» PL/SQL stored procedures are CALLED from within JDBC programs by means of the prepareCall() method of the Connection object created. A call to this method takes variable bind PARAMETERS as INPUT parameters as well as output variables and creates an object instance of the CALLABLESTATEMENT class. The following line of CODE illustrates this: CallableStatement stproc_stmt = conn.prepareCall("{call procname(?,?,?)}");Here conn is an instance of the Connection class.
PL/SQL stored procedures are called from within JDBC programs by means of the prepareCall() method of the Connection object created. A call to this method takes variable bind parameters as input parameters as well as output variables and creates an object instance of the CallableStatement class. The following line of code illustrates this: Here conn is an instance of the Connection class.
|
|
| 213. |
What Are Callable Statements ? |
|
Answer» Callable statements are used from JDBC application to INVOKE STORED procedures and FUNCTIONS. Callable statements are used from JDBC application to invoke stored procedures and functions. |
|
| 214. |
What Is Preparedstatement? |
|
Answer» A prepared statement is an SQL statement that is precompiled by the database. Through precompilation, prepared statements improve the performance of SQL commands that are executed multiple times (given that the database supports prepared statements). Once COMPILED, prepared statements can be customized prior to each execution by altering predefined SQL PARAMETERS. PreparedStatement pstmt = conn.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?");pstmt.setBigDecimal(1, 153833.00); pstmt.setInt(2, 110592); Here: conn is an instance of the Connection class and "?" represents parameters.These parameters must be SPECIFIED before execution. A prepared statement is an SQL statement that is precompiled by the database. Through precompilation, prepared statements improve the performance of SQL commands that are executed multiple times (given that the database supports prepared statements). Once compiled, prepared statements can be customized prior to each execution by altering predefined SQL parameters. Here: conn is an instance of the Connection class and "?" represents parameters.These parameters must be specified before execution. |
|
| 215. |
What Is Statement ? |
Answer»
|
|
| 216. |
What Does The Connection Object Represents? |
|
Answer» The CONNECTION OBJECT represents communication context, i.e., all communication with DATABASE is through connection object only. The connection object represents communication context, i.e., all communication with database is through connection object only. |
|
| 217. |
What Is Jdbc Driver Interface? |
|
Answer» 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, PREPARED Statement, CallableStatement, ResultSet and Driver. 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, Prepared Statement, CallableStatement, ResultSet and Driver. |
|
| 218. |
What Are The Main Components Of Jdbc ? |
|
Answer» The life cycle of a servlet CONSISTS of the following PHASES:
The life cycle of a servlet consists of the following phases: |
|
| 219. |
Explain Basic Steps In Writing A Java Program Using Jdbc? |
|
Answer» JDBC makes the interaction with RDBMS simple and intuitive. When a Java application NEEDS to access DATABASE :
JDBC makes the interaction with RDBMS simple and intuitive. When a Java application needs to access database : |
|
| 220. |
What Are The New Features Added To Jdbc 4.0? |
|
Answer» The major features added in JDBC 4.0 INCLUDE :
The major features added in JDBC 4.0 include : |
|
| 221. |
What Is The Jdbc? |
|
Answer» 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. 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. |
|