public Blog(int page_no){
        
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;
        try{
            conn = ConnectionManager.getConnection();
            stmt = conn.createStatement();
            int limit = page_no * 5;
            rs = stmt.executeQuery("SELECT COUNT(*) FROM post");
            rs.next();
            maxlength = (int)Math.ceil(rs.getInt("Count(*)")/5);              
                    
            rs = stmt.executeQuery("SELECT * FROM post ORDER BY post_date DESC LIMIT "+limit+",5");
            rs.last();
            int length = rs.getRow();
            rs.first();
            post = new Post[length];
            for(int i=0;i<length;i++){
                post[i] = new Post(rs.getInt("post_id"));
                rs.next();
            }
            
        }catch(SQLException sql){
            System.out.println("SQL ERROR" + sql.getMessage());
        }finally{
            
            if (rs != null)	{
                try {
                rs.close();
                } catch (Exception e) {}
                rs = null;
                }

            if (stmt != null) {
                try {
                stmt.close();
                } catch (Exception e) {}
                stmt = null;
                }

            if (conn != null) {
                try {
                conn.close();
                } catch (Exception e) {
                }

                conn = null;
            }
        }
        
    }