question: public void loadHamNSpam ( Connection conn ) throws java . sql . SQLException { PreparedStatement pstmt = null ; ResultSet rs = null ; try { pstmt = conn . prepareStatement ( sqlQueries . getSqlString ( "selectHamTokens" , true ) ) ; rs = pstmt . executeQuery ( ) ; Map < String , Integer > ham = getHamTokenCounts ( ) ; while ( rs . next ( ) ) { String token = rs . getString ( 1 ) ; int count = rs . getInt ( 2 ) ; if ( count > 1 ) { ham . put ( token , count ) ; } } log ( "Ham tokens count: " + ham . size ( ) ) ; rs . close ( ) ; pstmt . close ( ) ; pstmt = conn . prepareStatement ( sqlQueries . getSqlString ( "selectSpamTokens" , true ) ) ; rs = pstmt . executeQuery ( ) ; Map < String , Integer > spam = getSpamTokenCounts ( ) ; while ( rs . next ( ) ) { String token = rs . getString ( 1 ) ; int count = rs . getInt ( 2 ) ; if ( count > 1 ) { spam . put ( token , count ) ; } } log ( "Spam tokens count: " + spam . size ( ) ) ; rs . close ( ) ; pstmt . close ( ) ; pstmt = conn . prepareStatement ( sqlQueries . getSqlString ( "selectMessageCounts" , true ) ) ; rs = pstmt . executeQuery ( ) ; if ( rs . next ( ) ) { setHamMessageCount ( rs . getInt ( 1 ) ) ; setSpamMessageCount ( rs . getInt ( 2 ) ) ; } rs . close ( ) ; pstmt . close ( ) ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( java . sql . SQLException se ) { log ( "Failed to close statement after selecting spam tokens." , se ) ; } rs = null ; } if ( pstmt != null ) { try { pstmt . close ( ) ; } catch ( java . sql . SQLException se ) { log ( "Failed to close statement selecting message counts." , se ) ; } pstmt = null ; } } }
target:  Loads the token frequencies from the database.