0
是否有方法將語句1和語句2合併爲1個查詢?謝謝。jdbc聯合2 sql更新語句
String statement1 = "UPDATE thing SET status = ? WHERE id = ?";
String statement2 = "UPDATE thing SET error_message = ? WHERE id = ?";
PreparedStatement preparedStatement = connection.prepareStatement(statement1);
preparedStatement.setInt(1,status);
preparedStatement.setInt(2, id);
connection.prepareStatement(statement2);
preparedStatement.setInt(1,error_message);
preparedStatement.setInt(2, id);