Tuesday, April 29, 2008

(A) Cannot do the above because the program will give compilation error 'unreported exception java.lang.ExceptionClass1; declared to be thrown'(B) ExceptionClass1( twice ), ExceptionClass2 ( twice ), No output(C) ExceptionClass1( once ), ExceptionClass2( twice ), No output(D) Cannot do the above because the program will give compilation error 'incompatible types found : ExceptionClass1, required: java.lang.Throwable'

2. When trying to establish a JDBC connection, it fails with the message "Driver not found".

This is due to

(A) The DriverManager class is not found(B) The JDBC driver is not registered(C) The JDBC driver does not exist in the CLASSPATH(D) The Connection class is not found

While (result.next()) {System.out.println("The date of joining is " + result.getString(1));}}}}

Note: the column DATE OF JOINING is not null and it always has a value.

What would be the output of this code?

(A) This code does not compile(B) "The date of joining is 01-JUN-1999″. (The sample date fetched by the SQL stmt)(C) The code complies but results in run-time exception(D) "The date of joining is ". ( The date is null)

4. As far as handling null values in JAVA and SQL is concerned which of the following statements is wrong?

(A) For Java Objects SQL NULL maps to JAVA NULL(B) While using the method getInt( ), the JAVA NULL maps the SQL NULL(C) a Java ResultSet has no way of representing a SQL NULL value for any numeric SQL column(D) Call to getInt() could return some driver attempt at representing NULL, most likely 0.

5. As per the JDBC Specification for SQL to Java Datatype Mappings, which of the following statements is correct?

10. Which of the following is false with respect to updateable result sets

(A) The select should pertain to a single table and should include the primary key columns(B) JDBC drivers are not required to support updateable result sets(C) If the driver does not support updateable result set, it will always throw an exception(D) If the driver does not support updateable result set, it will issue a SQLWarning and assigns the result set to a type it can support.

11. Which of the following is not true about jsp:forward

(A) This allows the request to be forwarded to another JSP, a servlet or a static resource.(B) The resource to which the request is being forwarded should be in the same context as the JSP dispatching the request(C) Execution in the current JSP stops when it encounters jsp:forward tag(D) The output stream need not be buffered and it can contain some output written to it.

12. A session has been created by the client. If the client does not continue the session within a specified time, which of the following will not happen

(A) the server will expire the session and delete all data associated with the session(B) the server will expire the session but the data associated with the session are retained(C) The session key is invalidated(D) The old session key is not associated with any session