Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Random rand = new Random();
- int r = rand.nextInt(200);
- Connection co2 = null;
- PreparedStatement ps2 = null;
- ResultSet rs2 = null;
- try {
- Class.forName("com.mysql.jdbc.Driver");
- co2 = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "");
- ps2 = co2.prepareStatement("insert into class" + " values (?, ?, ?, ?)");
- ps2.setInt(1, r);
- ps2.setString(2, rs.getString("superClass"));
- ps2.setString(3, "Object");
- ps2.setString(4, null);
- ps2.execute();
- System.out.println("insert passé");
- list.add(rs.getString("superClass"));
- } finally {
- close(co2, ps2, rs2);
- }
- Random rand = new Random();
- int r = rand.nextInt(200);
- Connection co2 = null;
- PreparedStatement ps2 = null;
- ResultSet rs2 = null;
- try {
- Class.forName("com.mysql.jdbc.Driver");
- co2 = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "");
- ps2 = co2.prepareStatement("insert into class" + " values (?, ?, ?, ?)" + "insert into typeclass" + " values (?, ?, ?, ?)");
- ps2.setInt(1, r);
- ps2.setString(2, rs.getString("superClass"));
- ps2.setString(3, "Object");
- ps2.setString(4, null);
- ps2.setInt(5, r);
- ps2.setString(6, rs.getString("superClass"));
- ps2.setString(7, "Object");
- ps2.setString(8, null);
- ps2.execute();
- System.out.println("insert passé");
- list.add(rs.getString("superClass"));
- } finally {
- close(co2, ps2, rs2);
- }
- MySQLSyntaxErrorException near "insert into typeclass values (174, "JFrame", "Object", null)"
Add Comment
Please, Sign In to add comment