Font size
WorksheetsJDBC_Questions1
Total questions: 18
Worksheet time: 11mins
What JDBC stands for ?
Java Database Connectivity
Java Driver for Basic Connection
Joint Database Connectivity
Joint Driver for Basic Connection
How many Types of JDBC-Drivers available ?
5
4
3
6
Which JDBC Driver Type is the JDBC-ODBC bridge ?
Type-4
Type-3
Type-2
Type-1
Which driver is called as thin-driver in JDBC ?
Type-2
Type-4
Type-3
Type-1
Which driver is callled Native-API driver ?
Type-4
Type-2
Type-3
Type-1
What are the correct sequence of steps to connect any database using JDBC ?
import packages,load or register the driver class,establish connection,create the statement,execute queries,close the connection
establish connection,import packages,load or register the driver class,execute queries,create the statement,close the connection
create the statement,import the packages,establish connection,import packages,load or register the driver class,execute queries,close the connection
establish connection,create the statement,import the packages,import packages,load or register the driver class,execute queries,close the connection
Which of the following method is needed for loading a database driver in JDBC ?
registerDriver() method
Class.forName() method
Both 1 and 2
None of the above
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
------------- method is used to execute any SQL Statement with a SELECT clause, that return the result of the query as a
execute()
executeQuery()
executeUpdate()
executeBatch()
Which method is used to execute INSERT,DELETE,UPDATE and other SQL DDL commands such as CREATE or DROP Table?
execute()
executeQuery()
executeUpdate()
executeBatch()
What is return type of executeUpdate() method ?
int
String
Date
ResultSet
What are the different types of Statements available in JDBC?
Statement
PreparedStatement
CallableStatement
All of the above
Which type of Statement can execute parameterized queries ?
ParameterizedStatement
PreparedStatement
CallableStatement
All kinds of Statements (i.e. which implement a sub interface of Statement)
Which method returns ResultSet as output?
execute()
executeQuery()
executeUpdate()
executeBatch()
Which java.sql class or interface contains methods that enable you to find out the number of columns this is returned in a ResultSet and the name or label for a given column?
Statement
CallableStatement
ResultSetMetaData
MetaData
What are the Interfaces available in JDBC?
Connection interface
PreparedStatement interface
ResultSet interface
ResultSet interface
What are the methods in Statement Interface?
public ResultSet executeQuery(String sql): is used to execute SELECT query. It returns the object of ResultSet.
public int executeUpdate(String sql): is used to execute specified query, it may be create, drop, insert, update, delete etc.
public boolean execute(String sql): is used to execute queries that may return multiple results.
public int[] executeBatch(): is used to execute batch of commands.
This method is for retrieving a String Value(SQL type VARCHAR) and assigning to String Object.
getVarchar()
getString()
getObject()
getInt()
