Question - 1
What are the major components of the JDBC?
- DriverManager, Driver, Connection, Statement, and ResultSet
- DriverManager, Statement, and ResultSet
- DriverManager, Driver, Connection, and Statement
- DriverManager, Connection, Statement, and ResultSet
Solutions
Answer- A
Question - 2
Select the packages in which JDBC classes are defined?
- jdbc and javax.jdbc
- rdb and javax.rdb
- jdbc and java.jdbc.sql
- sql and javax.sql
Solutions
Answer- D
Question - 3
The thin driver is also known as?
- Type 3 Driver
- Type-2 Driver
- Type-4 Driver
- Type-1 Driver
Solutions
Answer- C
Question - 4
Which of the following method is used to perform DML statements in JDBC?
- executeResult()
- executeQuery()
- executeUpdate()
- execute()
Solutions
Answer- C
Question - 5
How many transaction isolation levels provide the JDBC through the Connection interface?
Answer- B
Question - 6
Which of the following method is static and synchronized in JDBC API?
- getConnection()
- prepareCall()
- executeUpdate()
- executeQuery()
Solutions
Answer- A
Question - 7
Which of the following is not a valid statement in JDBC?
- Statement
- PreparedStatement
- QueryStatement
- CallableStatement
Solutions
Answer- C
Question - 8
Which of the following type of JDBC drivers, uses database native protocol?
- JDBC-ODBC Bridge plus ODBC driver
- Native-API, partly Java driver
- JDBC-Net, pure Java driver
- Native-protocol, pure Java driver
Solutions
Answer- D
Question - 9
How does JDBC handle the data types of Java and database?
- The JDBC driver converts the Java data type to the appropriate JDBC type before sending it to the database.
- It uses a default mapping for most data types.
- Both A and B
- None of these
Solutions
Answer- C
Question - 10
What is, in terms of JDBC, a DataSource?
- A DataSource is the basic service for managing a set of JDBC drivers
- A DataSource is the Java representation of a physical data source
- A DataSource is a registry point for JNDI-services
- A DataSource is a factory of connections to a physical data source
Solutions
Answer- D
Question - 11
How can you execute a stored procedure in the database?
- Call method execute() on a CallableStatement object
- Call method executeProcedure() on a Statement object
- Call method execute() on a StoredProcedure object
- Call method run() on a ProcedureCommand object
Solutions
Answer- A
Question - 12
Which of the following statements is false as far as different types of statements are concerned in JDBC?
- Regular Statement
- Prepared Statement
- Callable Statement
- Interim Statement
Solutions
Answer- D
Question - 13
- Three tiered
- Multithreaded
- Best for any platform
- All of the above
Solutions
Answer- B
Question - 14
BLOB, CLOB, ARRAY, and REF type columns can be updated in:
- JDBC 1.0
- JDBC 4.0
- JDBC 2.0
- JDBC 3.0
Solutions
Answer- D
Question - 15
When does the message "No Suitable Driver" occur?
- When the driver is not registered by Class.forname() method
- When the user name, password and the database does not match
- When the JDBC database URL passed is not constructed properly
- When the type 4 driver is used
Solutions
Answer- C
Question - 16
What is the disadvantage of Type-4 Native-Protocol Driver?
- At client side, a separate driver is needed for each database.
- Type-4 driver is entirely written in Java
- The driver converts JDBC calls into vendor-specific database protocol
- It does not support to read MySQL data
Solutions
Answer- A
Question - 17
Identify the isolation level that prevents the dirty in the JDBC Connection class?
- TRANSACTION_READABLE_READ
- TRANSACTION_READ_COMMITTED
- TRANSACTION_READ_UNCOMMITTED
- TRANSACTION_NONE
Solutions
Answer- B
Question - 18
What does setAutoCommit(false) do?
- It will not commit transactions automatically after each query.
- It explicitly commits the transaction.
- It never commits the transactions.
- It does not commit transaction automatically after each query.
Solutions
Answer- B
Question - 19
A good way to debug JDBC-related problems is to enable:
- JDBC tracing
- Exception handling
- Both A and B
- Only B
Solutions
Answer- A
Question - 20
Which of the following is not a type of ResultSet object?
- TYPE_FORWARD_ONLY
- CONCUR_WRITE_ONLY
- TYPE_SCROLL_INSENSITIVE
- TYPE_SCROLL_SENSITIVE
Solutions
Answer- B
Practice more set questions