Unit 5 Set 1 Question-63
Unit 5 Set 1 Question-63
10. Which of the following is not a valid SQL data type in JDBC?
a) VARCHAR b) INT c) DOUBLE d) BOOLEAN
12. In JDBC, which exception is thrown when there is a problem with the SQL syntax?
a) SQLException b) SQLSyntaxException c) SQLQueryException d) SyntaxError
13. Which method is used to execute a query in JDBC and retrieve the results in a `ResultSet`?
a) executeQuery() b) executeUpdate() c) execute() d) executeBatch()
26. The package contains classes that help in connecting to a database, sending SQL statements to the database and process
the query request.
(a)connection.sql (b)b.sql (c)pkg.sql (d)java.sql
28.In JDBC imports all Java classes that are concern with Database connectivity.
(a) javax.sql (b)java.mysql (c)java.sql (d)com.sql
30.In the below statement, which type of query can be used with executeUpdate() method. statement.executeUpdate(query here)
(a)Insert, Update, Delete (b)Insert, Select, Delete (c)Only Select (d) Any Query
33. How Many Transaction isolation levels divide the JDBC through the connection interface?
a) 3 b) 4 c) 7 d) 2
34. Identify the isolation level the prevents the dirty in the JDBC connection class?
a) TRANSACTION_READABLE_READ
b) TRANSACTION_READ_COMMITED
c) TRANSACTION_READ_UNCOMMITED
d) TRANSACTION_NONE
35. 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?
a. Methods on the ResultSet class for retrieving SQL SELECT results as Java types.
b. Methods on the PreparedStatement class for sending Java types as SQL statement parameters.
c. Methods on the CallableStatement class for retrieving SQL OUT parameters as Java types.
d. All mentioned above
36. The JDBC API has always supported persistent storage of objects defined in the Java programming language through the
methods getObject and setObject.
a. True b. False
37.Which JDBC type represents a "single precision" floating point number that supports seven digits of mantissa?
a. REAL b. DOUBLE c. FLOAT d. INTEGER
38. Which method is used for retrieving streams of both ASCII and Unicode characters is new in the JDBC 2.0 core API?
a. getCharacterStream b. getBinaryStream c. getAsciiStream d. getUnicodeStream
39. How many Result sets available with the JDBC 2.0 core API?
a. 2 b. 3 c. 4 d. 5
41. The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.
a. True b. False
42. Which method Drops all changes made since the previous commit/rollback?
a. public void rollback() b. public void commit()
c. public void close() d. public Statement createStatement()
43. The intent is for JDBC drivers to implement nonscrollable result sets using the support provided by the underlying database
systems.
a. True b. False
44. Which methods returns a stream that simply provides the raw bytes from the database without any conversion?
a. getCharacterStream b. getBinaryStream c. getAsciiStream d. getUnicodeStream
49. Which JDBC driver types 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 b)Type 2 c)Type 3 and 4 d)Type 1, Type 2, Type 3 and Type 4
50. Which driver Network connection is indirect that a JDBC client makes to a middleware process that acts as a bridge to the
DBMS server?
a)JDBC-NET b)JDBC-ODBC Bridge c)Native api as basis d)native protocol as basis
59. Which of the following describes the correct sequence of the steps involved in making a connection with a database.
1. Loading the driver 2. Process the results.
3. Making the connection with the database. 4. Executing the SQL statements.
A. 1,3,4,2 B. 1,2,3,4 C. 2,1,3,4 D. 4,1,2,3
60. All raw data types (including binary documents or images) should be read and uploaded to the database as an array of
a. byte b. int c. Boolean d. char
62. Which statement type is used to execute SQL queries that do not return results, such as INSERT, UPDATE, and DELETE
statements?
A. PreparedStatement B. Statement