Java Code Examples for java.sql.ResultSet#toString()

The following examples show how to use java.sql.ResultSet#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MatchesAccess.java    From Math-Game with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: QueryTestCaseBase.java    From tajo with Apache License 2.0 5 votes vote down vote up
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());
  }
}
 
Example 3
Source File: AbstractResultSetType.java    From doma with Apache License 2.0 4 votes vote down vote up
@Override
protected String doConvertToLogFormat(ResultSet value) {
  return value.toString();
}