The given question ask me to complete the code to insert two rows in the given table as shown in the image. Some part of code is already given in question which I can't edit and some part of code is hidden and I just have to write the code segment to insert the data.
So , tried below code
stmt.executeUpdate(CREATE_TABLE_SQL);
PreparedStatement preparedStmt = conn.prepareStatement("insert into Players values(?,?,?,?)");
preparedStmt.setInt (1, 1);
preparedStmt.setString (2, "Ram");
preparedStmt.setString (3, "Gopal");
preparedStmt.setInt(4, 26);
int x= preparedStmt.executeUpdate();
PreparedStatement preparedStmt2 = conn.prepareStatement("insert into Players values(?,?,?,?)");
preparedStmt2.setInt (1, 2);
preparedStmt2.setString (2, "John");
preparedStmt2.setString (3, "Mayer");
preparedStmt2.setInt(4, 22);
int y= preparedStmt2.executeUpdate();
This code is passing private cases and its shown wrong answer in private case. I can't figure out where is the mistake.
I want to pass private test case.