Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Database (http://www.go4expert.com/forums/database-forum/)
-   -   JDBC-ODBC Connection (http://www.go4expert.com/forums/jdbc-odbc-connection-t7734/)

ravi_elite235 6Dec2007 11:32

JDBC-ODBC Connection
 
Hi,
can anyone know the answer for this question?
Code:

Connection con = DriverManager.getConnection (
"jdbc:odbc:wombat", "login", "password");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM Table1");
while (rs.next()) {
Integer x = rs.getInt("c");
String s = rs.getString("a");
Float f = rs.getFloat("b");
}

What is WRONG with the code above?
Choice 1
Retrieval of the fields is in the wrong order.
Choice 2
The password must be encrypted before being sent to the DriverManager.
Choice 3
The Driver's URL is in the wrong format.
Choice 4
The ResultSet class returns primitive types for integers and floats.
Choice 5
The SQL statement is invalid.

shabbir 6Dec2007 17:24

Re: JDBC-ODBC Connection
 
I see choice 4 as all the other option are not applicable.


All times are GMT +5.5. The time now is 22:07.