public ResultSet executeQuery(String query) throws SQLException, NoConnectionException {
  if (connection != null) {
    Statement st=connection.createStatement();
    return st.executeQuery(query);
  }
  throw new NoConnectionException();
}

public ResultSet executeQuery ( String query ) throws SQLException , NoConnectionException { if ( connection != null ) { Statement st = connection . createStatement ( ) ; return st . executeQuery ( query ) ; } throw new NoConnectionException ( ) ; }
executes an sql query
