NEW
Font size
WorksheetsJDBC in java
Total questions: 20
Worksheet time: 10mins
Which of the following is not a valid type of statement in JDBC?
Statement
PreparedStatement
CallableStatement
QueryStatement
Which of the following encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed?
DriverManager
JDBC driver
Connection
Statement
What is true about DriverManager class?
It is class from java.lang package
It is a class from java.sql package
It is a interface from java.sql package
It is a class from java.lang package
What is the return type of executeUpdate() method?
byte
short
int
long
In Type 2 Driver, JDBC API calls are converted into native _____________ API calls, which are unique to the database
C/C++
Java
JavaScript
Visual Programming
The third step involved in JDBC application is ____________
Execute Query
Establish Connection
importing packages
Register the Driver
___________ interface with all methods for contacting a database.
ResultSet
Statement
Connection
Driver
_____________ interface handles the communications with the database server
DriverManager
Driver
Statement
None of these
Which of the following tasks are associated with JDBC library?
Making a connection to a database.
Creating SQL or MySQL statements.
Executing SQL or MySQL queries in the database.
All of these
Which method is used to perform DML statements in JDBC?
execute()
executeQuery()
executeUpdate()
executeResult()
Which of the following is used to rollback a JDBC transaction?
rollback()
rollforward()
deleteTransaction()
RemoveTransaction()
Which models do the JDBC API support for the database access?
Two-tier models
Three-tier models
Both A & B
None of the above
ODBC stands for?
Open database connection
Open database concept
Open database communications
None of the above
Which is used to call the stored procedures and functions?
CallableStatement Interface
PreparedStatement Interface
All the above
None of the above
Which method is used to establish the connection with the specified url in a Driver Manager class?
public static void registerDriver(Driver driver)
public static void deregisterDriver(Driver driver)
public static Connection getConnection(String url)
public static Connection getConnection(String url,String userName,String password)
In order to transfer data between a database and an application written in the Java programming language, the JDBC API provides which of these methods?
Methods on the ResultSet class for retrieving SQL SELECT results as Java types.
Methods on the PreparedStatement class for sending Java types as SQL statement parameters.
Methods on the CallableStatement class for retrieving SQL OUT parameters as Java types.
All mentioned above
Which method is used to perform DML statements in JDBC?
execute()
executeQuery()
executeUpdate()
executeResult()
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
Which type of Statement can execute parameterized queries?
PreparedStatement
ParameterizedStatement
ParameterizedStatement and CallableStatement
All kinds of Statements (i.e. which implement a sub interface of Statement)
Which packages contain the JDBC classes?
java.jdbc and javax.jdbc
java.jdbc and java.jdbc.sql
java.sql and javax.sql
java.rdb and javax.rdb
