a Client to a RDBMS Server. Complete the following JDBC codes to write the output in a console as below. Fill the missin
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
a Client to a RDBMS Server. Complete the following JDBC codes to write the output in a console as below. Fill the missin
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!