Q.1.

Suppose you have following table.

CREATE TABLE TBL1(COUNT NUMBER(11),TITLE CHAR(20));

INSERT INTO TBL1 VALUES(NULL,’BOOKS’);

What will be the output after running following code snippet?

...
ResultSet rs
= st.executeQuery("select * from table1;");
rs.next();
System.out.println(rs.getInt(
1));
System.out.println(rs.getString(
2));
...

A. 0 pen

B. Null pen

C. Nullpointerexception

Q.2.

What actions can be executed in JDBC API with batch?

  1. Insert
  2. Update
  3. Delete
  4. Select
  5. Create
  6. Drop

Q.3.

Suppose you need to get JDBC connection. How can you do that?

  1. DriverManager.getConnection(String url, String user, String password)
  2. DriverManager.getConnection(String url, Properties info)
  3. DriverManager.getConnection(String url)
  4. DriverManager.getConnection()

Q.4.

In XML, DTD stands for

  1. Document Type Declaration
  2. Document Type Definition
  3. Data Type Declaration
  4. It's just a name, It does not stand for anything

Q.5.

Let's assume, that statement is prepared properly. What will be the result of following code?

...
...
PreparedStatement ps
= con.prepareStatement("UPDATE MYTABLE SET COL1=? WHERE COL2=?");
ps.setBigDecimal(
1,newBigDecimal("153833.00"));
ps.setInt(
1,110592);
ResultSet rs
= ps.executeQuery();
...
...
...
rs.close();
ps.close();
c.close();

Q.6.

XML tags are case sensitive, and it is legal to omit the closing tag.

A. True

B. False

Q.7.

Which processing instructions are correct?

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <?xml encoding="UTF-8" version="1.0" ?>
  3. <?xml version="1.0" ?>
  4. <?xml encoding="UTF-8" ?>
  5. <?xml version="1.0" encoding="UTF-8"?>
  6. <?xml ?>

Q.8.

Even if the table MY_TABLE does not exist in the database, it is possible to create a PreparedStatement, for example:

try

{
PreparedStatement stmt = con.prepareStatement("select * from MY_TABLE”);

System.out.println(“statement object created”);

}

catch(SQLException e)

{

}

Creating only this statement, will compile and print “statement object created”.

  1. True
  2. False