@Override
	public ResultSet query(String query) {
		Statement statement = null;
		ResultSet result = null;
		
		try {
			connection = this.open();
			statement = connection.createStatement();
			
			switch (this.getStatement(query)) {
				case SELECT:
					result = statement.executeQuery(query);
					return result;
					
				default:
					statement.executeQuery(query);
					return result;	
			}
		} catch (SQLException ex) {
			if (ex.getMessage().toLowerCase().contains("locking") || ex.getMessage().toLowerCase().contains("locked")) {
				return retry(query);
				//this.writeError("",false);
			} else if (ex.getMessage().toLowerCase().contains("query does not return resultset")) {
                            return null;
                        } else {
				this.writeError("Error at SQL Query: " + ex.getMessage(), false);
			}
			
		}
		return null;
	}