Page 1 of 1

a Client to a RDBMS Server. Complete the following JDBC codes to write the output in a console as below. Fill the missin

Posted: Thu Jul 14, 2022 2:17 pm
by answerhappygod
A Client To A Rdbms Server Complete The Following Jdbc Codes To Write The Output In A Console As Below Fill The Missin 1
A Client To A Rdbms Server Complete The Following Jdbc Codes To Write The Output In A Console As Below Fill The Missin 1 (277.31 KiB) Viewed 39 times
a Client to a RDBMS Server. Complete the following JDBC codes to write the output in a console as below. Fill the missing codes at (1), (2), (3, and (4) in the JDBC codes below. import java.sql.Connection; public class MyJDBCSQLConnection \{ public static void main(String[] args) throws ClassNotFoundException, SQLException \{ Class.forName("com.mysql.jdbc.Driver"); Connection cnn= DriverManager.getConnection( if (cnn == null) \{ System.out.print/n("Problems: No connection..."); System.exit(0); \} System.out.print/n("Success: connection is available..."); Statement stmt = cnn.createStatement () ; String mySQL = (1) " PreparedStatement stm = (2) (mySQL, ResultSet.FETCH_'FORWARD); stm.setString(1, "4"); (3) is = stm executeQuery(); (4) \{ System.out printin(rs.getString("ssn") + " " + rs.getString("dno") + " " + rs.getString("Fname") + " " + rs.getString("Lname")); 3 rs.close(); cnn.close(); \} //Main PreparedStatement - Employees working for Dno 4 9876543214 Jennifer Wallace 9879879874Ahmad Jabbar 9998877774 Alicia Zelaya