Advanced Java Programming (3160707) MCQs

MCQs of JDBC Programming

Showing 31 to 40 out of 45 Questions
31.
______contains date information?
(a) java.sql.TimeStamp
(b) java.sql.Time
(c) java.io.Time
(d) java.io.TimeStamp
Answer:

Option (a)

32.
______ is an open source DBMS that runs on UNIX, Linux and Windows
(a) MySQL
(b) JDBC/SQL
(c) MSAccess
(d) SQLServer
Answer:

Option (a)

33.
Which method executes a simple query and returns a single Result Set object?
(a) executeQuery()
(b) executeUpdate()
(c) execute()
(d) run()
Answer:

Option (a)

34.
The JDBC-ODBC bridge is ______
(a) Multithreaded
(b) Single threaded
(c) both A&B
(d) None of these
Answer:

Option (a)

35.
Which of the following allows non repeatable read in JDBC Connection?
(a) TRANSACTION_READ_COMMITTED
(b) TRANSACTION_READ_UNCOMMITTED
(c) TRANSACTION_REPEATABLE_READ
(d) TRANSACTION_SERIALIZABLE
Answer:

Option (c)

36.

Which of the following is correct connection string for mysql database access ?

(a)

"jdbc:mysql://localhost:3306/gtu"

(b)

"mysql:jdbc://localhost:3306/gtu"

(c)

"jdbc:mysql:C:/mysql /db/gtu”

(d)

"jdbc:sqlite://localhost:3306/gtu"

Answer:

Option (a)

37.

What is the correct order to close database resources?

(a)

Connection then Statement then ResultSet

(b)

ResultSet then Statement then Connection

(c)

Statement then Connection then ResultSet

(d)

Statement then ResultSet then Connection

Answer:

Option (b)

38.

Which method Drops all changes made since the previous commit/rollback?

(a)

rollback()

(b)

commit()

(c)

close()

(d)

close()

Answer:

Option (a)

39.

Which of following statement is false for PreparedStatement ?

(a)

PreparedStatement is used to execute the parameterized query.

(b)

Query is compiled only once.

(c)

PreparedStatement is used when we need to provide input parameters to the query at runtime.

(d)

In the PreparedStatement, the query is compiled each time we run the program.

Answer:

Option (d)

40.

The executeUpdate method can be used with ____________.

(a)

Statements(Select and Update both)

(b)

Select statement.

(c)

Update/delete/insert operations in the database.

(d)

Only insert operation.

Answer:

Option (c)

Showing 31 to 40 out of 45 Questions