Package com.pugh.sockso.db

Examples of com.pugh.sockso.db.Database.prepare()


        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final MyCoverSearch s = new MyCoverSearch( db );
        final String name = s.getMusicItemName( "ar123" );
       
View Full Code Here


        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final MyCoverSearch s = new MyCoverSearch( db );
        final String name = s.getMusicItemName( "tr345" );
       
View Full Code Here

        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final MyCoverSearch s = new MyCoverSearch( db );
        final String name = s.getArtistName( albumId );
       
View Full Code Here

        expect( st.executeQuery() ).andReturn( rs ).times( 1 );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final MyCoverSearch s = new MyCoverSearch( db );
        final String name = s.getArtistName( albumId );
       
View Full Code Here

        expect(st.executeQuery()).andReturn(rs);
        st.close();
        replay(st);

        final Database db = createMock(Database.class);
        expect(db.prepare((String) anyObject())).andReturn(st);
        replay(db);

        coverer.setDatabase(db);
        final File[] dirs = coverer.getLocalCoverDirectories("ar123");
View Full Code Here

            final Database db = getDatabase();
            final User user = getUser();
            final String sql = " insert into play_log ( track_id, date_played, user_id ) " +
                               " values ( ?, current_timestamp, ? ) ";
           
            st = db.prepare( sql );
            st.setInt( 1, track.getId() );
           
            if ( user != null )
                st.setInt( 2, user.getId() );
            else
View Full Code Here

            final Database db = getDatabase();
            final String sql = " update play_log " +
                               " set scrobbled = 1 " +
                               " where user_id = ? ";

            st = db.prepare( sql );
            st.setInt( 1, user.getId() );
            st.executeUpdate();

        }
       
View Full Code Here

                                  " inner join genres g " +
                                  " on g.id = t.genre_id " +
                              " where l.user_id = ? " +
                                  " and l.scrobbled = 0 ";

            st = db.prepare( sql );
            st.setInt( 1, user.getId() );
            rs = st.executeQuery();

            return Track.createListFromResultSet( rs );
View Full Code Here

            final String sql = " update users " +
                               " set email = ?, " +
                                   " pass = ? " +
                               " where id = ? ";
           
            st = db.prepare( sql );
            st.setString( 1, req.getArgument("email") );
            st.setString( 2, Utils.md5(req.getArgument("pass1")) );
            st.setInt( 3, user.getId() );
            st.execute();
           
View Full Code Here

            final String sql = " select id, name " +
                               " from users " +
                               " where name = ? " +
                               " limit 1 ";

            st = db.prepare( sql );
            st.setString( 1, name );
            rs = st.executeQuery();

            if ( rs.next() ) {
                return new User( rs.getInt("id"), rs.getString("name") );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.