1) 1) Regarding mapping of types which of the following statements is not correct?
a) The many SQL types will often map to the same Java type.
b) Both Java primitives and object types can be mapped to SQL types.
c) Java wrapper classes are used extensively in mapping object type
to SQL types.
d) Because SQL has more data types then Java Object class types are
used
to make up the difference.
( d )
// Comment: d is fiction. It is true that there
are more SQL types than Java types.
// Mapping Java primitives and Java object types
are separate issues.
2) In a Java url the subname may contain all but
one of the following. Which does
not belong.
a) domain name or IP address
b) database file name
c) driver maker
d) a user_name & password.
( c )
3) Which of the following is not correct regarding the connect( ) method?
a) The connect( ) method is usually called indirectly in a JDBC program.
b) The connect( ) method throws an SQLException if the url is valid
but the
connection fails.
c) connect( ) is one of several methods in DriverManager used to connect
to
databases.
d) Network indirection, can be used to hide away
the connection information.
( c )
4) DataSource is preferred over DriverManager
a) as it lets an application use JNDI to locate databases
b) offers support for complex transactions
c) replaces getConnection( ) with the easier to
use getDataSource( ) method
d) permits use of pooled connections
( c )
5) a) The driver class can be supplied to the
application using the java.lang.System
property "jdbc.driver".
b) The static getClass( )
method of class Class can also be used to supply the
Driver implementation.
c) The driver implementation
uses a static initializer to instantiate and register the
driver with the DriverManager
class.
d) DriverManager will attempt
to locate a suitable driver from among it's list of those
loaded at initialization and
those loaded explicitly. ( b
)
// Comment: The method is forClass( ) in class Class.
6) Which of the following statements is not correct?
a) Connection methods are used to return different
types of Statement objects
b) The executeUpdate( ) is used for SQL updates while all other SQL
commands
should use executeQuery( ).
c) Statement descendents are used to execute stored procedures.
d) Statement descendents are used to execute prepared statements.
( b )