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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post 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 38 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply