@ Override public void load ( UnitDaoFactory unitDaoFactory ) { BufferedReader reader = new BufferedReader ( new InputStreamReader ( fileInputStream ) ) ; BufferedReaderIterator iterator = new BufferedReaderIterator ( reader ) ; StringBuilder currentQuery = new StringBuilder ( ) ; while ( iterator . hasNext ( ) ) { String line = iterator . next ( ) . trim ( ) ; if ( ! isCommentOrEmptyLine ( line ) ) { currentQuery . append ( line ) . append ( " " ) ; } if ( isEndOfQuery ( line ) ) { unitDaoFactory . getUnitDao ( ) . execute ( currentQuery . toString ( ) ) ; currentQuery = new StringBuilder ( ) ; } } }
Execute the SQL file s content .