Question: What will this code do ? Connection conn = DriverManager.getConnection ( jdbc:mysql: / / localhost / library , user, pass ) ; PreparedStatement
What will this code do
Connection conn DriverManager.getConnectionjdbc:mysql:localhostlibrary "user", "pass";
PreparedStatement ps conn.prepareStatementDELETE FROM books WHERE id ;
pssetInt;
int rowsAffected psexecuteUpdate;
System.out.printlnrowsAffected;
a
Does nothing since executeQuery is missing.
b
Prints the number of rows affected.
c
Deletes the book with id
d
Throws a SQL syntax error. it is possible to choice more than one
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
