@Override public void emitTuples(){
  String query=queryToRetrieveData();
  logger.debug(String.format("select statement: %s",query));
  try {
    ResultSet result=queryStatement.executeQuery(query);
    if (result.next()) {
      do {
        T tuple=getTuple(result);
        outputPort.emit(tuple);
      }
 while (result.next());
    }
  }
 catch (  SQLException ex) {
    store.disconnect();
    throw new RuntimeException(String.format("Error while running query: %s",query),ex);
  }
}

@ Override public void emitTuples ( ) { String query = queryToRetrieveData ( ) ; logger . debug ( String . format ( "select statement: %s" , query ) ) ; try { ResultSet result = queryStatement . executeQuery ( query ) ; if ( result . next ( ) ) { do { T tuple = getTuple ( result ) ; outputPort . emit ( tuple ) ; } while ( result . next ( ) ) ; } } catch ( SQLException ex ) { store . disconnect ( ) ; throw new RuntimeException ( String . format ( "Error while running query: %s" , query ) , ex ) ; } }
this executes the query to retrieve result from database . it then converts each row into tuple and emit that into output port .
