@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.execute(query);
				return result;
			}
		} catch (SQLException ex) {
			if (ex.getMessage().toLowerCase().contains("locking") || ex.getMessage().toLowerCase().contains("locked")) {
				return retry(query);
				// this.writeError("",false);
			} else {
				this.writeError("Error at SQL Query: " + ex.getMessage(), false);
			}

		}
		return null;
	}