hi,
this is one of the questions from the mock exams.
question:
---------
import java.sql.*;
Additional code here
Connection c; c=DriverManager.getConnection("jdbc:msql://host:12/dta");
String str = "update employee set salary=50000
where lname=\'jones\'";
What code would execute the SQL statement above?
options:
-------
Choice 1
Statement s = c.createStatement();
ResultSet rs = s.executeUpdate(str);
Choice 2
PreparedStatement s = c.prepareStatement(str);
ResultSet rs = s.executeUpdate();
Choice 3
c.setSQL(str);
ResultSet rs = c.execute();
Choice 4
ResultSet rs = c.executeUpdate(str);
Choice 5
CallableStatement s = c.createCall(str);
ResultSet rs = s.executeCall();
what would be the appropriate answer?.
arun.