JDBC Questions With Ans
JDBC Questions With Ans
b) When the user name, password and the database does not match
driver in JDBC?
a)registerDriver() method
b)Class.forName()
c)Both A and B
d)getConnection()
a)JDBC 1.0
b)JDBC 4.0
c)JDBC 2.0
d)JDBC 3.0
a)Statement
b)Callable Statement
d)Prepare Statement
a)executeQuery()
b) executeUpdate()
c) getConnection()
d) prepareCall()
concern in JDBC?
a)Regular Statement
b)Prepared Statement
c)Callable Statement
d)Interim Statement
Ques8)All raw data types should be read and uploaded to the database
as an array of?
a)byte
b)int
c)boolean
d)char
a)execute()
b)executeQuery()
c)executeUpdate()
d)executeResult()
Ques12)JDBC is a ..................... interface, which means that it is used to invoke SQL commands
directly?
A) low-level
B) middle-level
C) higher-level
D) user
Ques13)Which JDBC driver Type(s) can be used in either applet or servlet code?
d) Type 4 only
Ques14)Which JDBC driver Type(s) can you use in a three-tier architecture and if the Web server and
the DBMS are running on the same machine?
a) Type 1 only
b) Type 2 only
Ques15) ODBC is not appropriate for direct use from java because it uses a ..............
a) C interface
b) C# interface
c) java interface
d) Both A and C
d) JDBC is an API to bridge the object-relational mismatch between OO programs and relational
databases
Ques17) Which type of driver converts JDBC calls into the network protocol used by the database
management system
directly?
a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
a) PreparedStatement
b) ParameterizedStatement
a) By invoking the method get(..., String type) on the ResultSet, where type is the database type
c) By invoking the method getValue(...), and cast the result to the desired Java type.
d) By invoking the special getter methods on the ResultSet: getString(...), getBoolean (...),
getClob(...),...
a) The row you are positioned on is deleted from the ResultSet, but not from the database.
b) The row you are positioned on is deleted from the ResultSet and from the database.
c)The result depends on whether the property synchronizeWithDataSource is set to true or false
d) You will get a compile error: the method does not exist because you can not delete rows from a
ResultSet
Ques22) The JDBC-ODBC Bridge supports multiple concurrent open statements per connection?
a) True
b) False
88. con.close();
91. }
Ques25)How can you execute DML statements (i.e. insert, delete, update) in
the database?
UpdateStatement classes
DataModificationStatement object.
Ques25)What is, in terms of JDBC, a DataSource?
a)Yes,They complied
a) DDL statements are treated as normal SQL statements, and are executed by calling the execute()
method on a Statement (or a sub interface thereof) object
c) DDL statements can not be executed by making use of JDBC, you should use the native database
tools for this.
a)TRANSACTION_READ_UNCOMMITTED
b) TRANSACTION_READ_COMMITTED
c) TRANSACTION_SERIALIZABLE
d) TRANSACTION_REPEATABLE_READ
a) java.sql.Time
b) java.util.Date
c) java.util.Time
a)TYPE-4
b)TYPE-2
c)TYPE-1
d)TYPE-3