public ResultSet queryResult(String query) {
				
		try {
			final Connection connection = getConnection();
			if (connection == null) {
				Utilities.outputError("Could not connect to database '" + m_databaseName + "' using '" + m_options.username + "'@'" + m_options.host + ":" + m_options.port + "' using password '" + (m_options.password.length() == 0 ? "NO" : "YES") + "'");
				return null;
			}
			
			if (m_statement != null) {
				m_statement.close();
				m_statement = null;
			}
			
			m_statement = connection.createStatement();
			ResultSet result = m_statement.executeQuery(query);
			
			if (result == null) {
				m_statement.close();
				m_statement = null;
				connection.close();
			}

			return result;
			
		} catch (SQLException e) {
			e.printStackTrace();
			return null;
		}
	}