Question: 1. What will the following piece of Java code do? In one to two short sentences, describe how this Java code [does | does

1. What will the following piece of Java code do? In one to two short sentences, describe how this Java code [does | does not] change the state of the database. public static void insert Employee (Connection conn, int sen, String fname, String Iname, double salary). ( try { String query = "insert into EMPLOYEE (SSN, Fname, Lname, Salary) values (?, ?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement (query); stmt.setInt(1, ssn); stmt.setString (2, fname); stmt.setString (3, Iname); stmt.setDouble (4, salary); stmt.executeUpdate(); System.println("Successfully inserted employee record."); } catch (SQLException e) { System.out.println (e.getMessage()); 2. Beyond what the Java code does or doesn't do with the database, there is something that this Java code does wrong (or is missing). Explain why this Java code is written poorly (using a brief statement of concepts, not necessarily looking for a code solution - hint: what happens if this method is in a loop and is called a few thousand times?)
Step by Step Solution
There are 3 Steps involved in it
1 This Java code will insert a new record into the EM... View full answer
Get step-by-step solutions from verified subject matter experts
