Package com.lichtfragmente.beans

Examples of com.lichtfragmente.beans.ImageBean


                //make the keyword lowercase to make the search case insensitive
                stmt.setString(1,tag.toLowerCase());
                ResultSet result=stmt.executeQuery();

                while (result.next()) {
                    ImageBean temp=new ImageBean();

                    temp.setId(result.getInt(1));
                    temp.setTitle(result.getString(2));

                    list.add(temp);
                }
            } catch (SQLException sql) {
                throw new ServletException("Could not perform search: "+sql.getMessage());
View Full Code Here


            //get user information
            UserBean userinfo=this.getUserInformation(userid);
            request.setAttribute("user",userinfo);

            //get featured image randomly
            ImageBean featured=this.getFeatured(userid);
            request.setAttribute("featured",featured);

            //get list of followers
            Vector<UserBean> followers=this.getFollowers(userid);
            request.setAttribute("followers",followers);
View Full Code Here

                stmt.setInt(1,userid);
                ResultSet result=stmt.executeQuery();

                //wrap information and add it to list
                while (result.next()) {
                    ImageBean temp=new ImageBean();

                    temp.setId(result.getInt("id"));
                    temp.setTitle(result.getString("title"));

                    resultList.add(temp);
                }

                result.close();
View Full Code Here

     * @param userid ID of the user for which we want a featured image
     * @return A random image from the database as bean
     **/
    private ImageBean getFeatured(int userid)
    throws ServletException {
        ImageBean temp=null;
       
        synchronized(this) {
            try {
                //select random image from DB
                PreparedStatement stmt=DBInterface.doQuery("SELECT id,title " +
                                                           "FROM image " +
                                                           "WHERE owner=?" +
                                                           "ORDER BY RANDOM() LIMIT 1;");
                stmt.setInt(1,userid);
                ResultSet result=stmt.executeQuery();

                if (result.next()) {
                    temp=new ImageBean();

                    temp.setId(result.getInt(1));
                    temp.setTitle(result.getString(2));
                }

                result.close();
                stmt.close();
                DBInterface.close();
View Full Code Here

TOP

Related Classes of com.lichtfragmente.beans.ImageBean

Copyright © 2018 www.massapicom. 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.