When the code comes to the step "pstmt.executeUpdate()" it freezes and blocked and I didn't receive any SQL exception
This is works:
SQL = "INSERT INTO Procedure (file_path,id) VALUES ('/test/file_test.pdf',512);";
pstmt = con.prepareStatement(SQL,Statement.RETURN_GENERATED_KEYS);
pstmt.executeUpdate();
This doesn't work! and I don't receive any exception and it is blocked:
SQL = "INSERT INTO Procedure (file_path,id) VALUES (?,?);";
pstmt = con.prepareStatement(SQL,Statement.RETURN_GENERATED_KEYS);
pstmt.setString(1, "/test/file_test.pdf");
pstmt.setInt(2, 512);
pstmt.executeUpdate();
I don't understand why my code is blocked when I use the next solution (I mean setString
and setInt
).