tests/data/src/db/Database.java
/***
	 * Performs a query in the database with parameters
	 * @param sql The query to run, with parameters substituted with ?'s
	 * @param params The array of parameters
	 * @return DBResult the results of the query
	 */
Performs a query in the database with parameters
@param sql The query to run, with parameters substituted with ?'s
@param params The array of parameters
@return DBResult the results of the query
Performs a query in the database with parameters @param sql The query to run with parameters substituted with ? ' s @param params The array of parameters @return DBResult the results of the query
public DBResult query(String sql, Object[] params) {
		ResultSet resultSet = null;
		DBResult result = null;
		try {
			PreparedStatement prepStmt = this.connection.prepareStatement(sql);
			for (int i = 1; i <= params.length; i++) {
				prepStmt.setObject(i, params[i-1]);
			}
			resultSet = prepStmt.executeQuery();
			result = new DBResult(resultSet);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return result;
	}
public DBResult query ( String sql , Object [ ] params ) { ResultSet resultSet = null ; DBResult result = null ; try { PreparedStatement prepStmt = this . connection . prepareStatement ( sql ) ; for ( int i = 1 ; i <= params . length ; i ++ ) { prepStmt . setObject ( i , params [ i - 1 ] ) ; } resultSet = prepStmt . executeQuery ( ) ; result = new DBResult ( resultSet ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } return result ; }
Performs a query in the database with parameters
 @param sql The query to run, with parameters substituted with ?
Performs a query in the database with parameters @param sql The query to run with parameters substituted with ?
//			Statement statement = this.connection.createStatement();