Package com.pugh.sockso.db

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


                       " left outer join tracks t " +
                       " on t.artist_id = ar.id " +
                  " where ar.id = ? " +
                  " group by ar.id, ar.name, ar.date_added " +
                  " limit 1 ";
            st = db.prepare( sql );
            st.setInt( 1, artistId );
            rs = st.executeQuery();
            if ( !rs.next() )
                throw new BadRequestException( "artist not found", 404 );
           
View Full Code Here


                        " inner join " +type+ "s ar " +
                        " on ar.id = t." +type+ "_id " +
                    " group by ar.id, ar.name " +
                    " order by mostRecent desc " +
                    " limit ? ";
        st = db.prepare( sql );
        st.setInt( 1, (int) p.get(totalPropertyName,10) );

        return st.executeQuery();

    }
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 File playlistFile = new File( "myPlaylist.m3u" );
        final ImportPlaylist ip = new ImportPlaylist( null, db, null, null, new TestLocale() );
       
View Full Code Here

        expect( st.execute() ).andReturn( true );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final Streamer s = new Streamer();
        s.setDatabase( db );
       
View Full Code Here

        expect( st.execute() ).andReturn( true );
        st.close();
        replay( st );
       
        final Database db = createMock( Database.class );
        expect( db.prepare((String)anyObject()) ).andReturn( st ).times( 1 );
        replay( db );
       
        final Streamer s = new Streamer();
        s.setDatabase( db );
        s.setUser( user );
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 MyWebAction wa = new MyWebAction();
        wa.setDatabase( db );
       
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 ByLetterer b = new ByLetterer();
        b.setDatabase( db );
       
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 ByLetterer b = new ByLetterer();
        b.setDatabase( db );
       
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 Artister b = new Artister();
        b.setDatabase( db );
        final Artist artist = b.getArtist( 123 );
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 Artister b = new Artister();
        b.setDatabase( db );
        boolean gotException = false;
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.