For the given code, if con is a valid Connection object, and the table Customer is empty, what will be output of this code?
try {
con = DriverManager.getConnection(url,uid,pwd);
Statement stmnt = con.createStatement();
rs = stmnt.executeQuery("select * from customer");
if (rs.next())
rs.getString(2);
} catch (SQLException e) {
e.printStackTrace();
}
Runtime exception at line 1 as getString(2) is not possible with the given select query
No exception , code runs fine
Runtime exception at line 1 as rs.next() will throw an exception
Compile time exception at line 1 as getString(2) is not possible with the given select query
To get all Infosys Certified Java Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee