下面列出了java.sql.ResultSet#toString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Checks whether both players' scores have been updated
* @return Whether the scores have been updated (true) or not
*/
public boolean checkForPlayersScoresUpdated(int currentScore1, int currentScore2) {
try {
System.out.println("matchnum in checkscores is " + matchNum);
ResultSet resultSet = statement.executeQuery("select * from sofiav_mathgame.matches where ID=" + matchNum);
resultSet.next();
resultSet.toString();
resultSet.getInt("Player1Score");
resultSet.getInt("Player2Score");
if ((resultSet.getInt("Player1Score") != currentScore1) && (resultSet.getInt("Player2Score") != currentScore2)) {
System.out.println("Both players' scores have updated");
return true;
}
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
public static QueryId getQueryId(ResultSet resultSet) {
if (resultSet instanceof TajoMemoryResultSet) {
return ((TajoMemoryResultSet) resultSet).getQueryId();
} else if (resultSet instanceof FetchResultSet) {
return ((FetchResultSet) resultSet).getQueryId();
} else {
throw new IllegalArgumentException(resultSet.toString());
}
}
@Override
protected String doConvertToLogFormat(ResultSet value) {
return value.toString();
}