Given the structure of the STUDENT table:
Student (id INTEGER, name VARCHAR)
Given:
public class Test {
static Connection newConnection =null;
public static Connection get DBConnection () throws SQLException { try (Connection con = DriveManager.getConnection(URL, username, password)) { newConnection = con;
}
return newConnection;
}
public static void main (String [] args) throws SQLException { get DBConnection ();
Statement st = newConnection.createStatement();
st.executeUpdate("INSERT INTO student VALUES (102, "˜Kelvin')");
}
}
Assume that:
The required database driver is configured in the classpath.
The appropriate database is accessible with the URL, userName, and passWord exists.
The SQL query is valid.
What is the result?
adnano1234
Highly Voted 5 years, 3 months agoaf8c3f3
Most Recent 2 months, 1 week agoDarGrin
10 months, 3 weeks agoDarGrin
11 months, 1 week agoDarGrin
10 months, 3 weeks agosteefaand
1 year, 2 months agor1muka5
2 years, 1 month agoWilsonKKerll
3 years, 1 month agomevlt
3 years, 2 months agoTarik2190
4 years agoDestroyer
5 years, 4 months ago