public static int addPost(String student_id, long offering_id, String content, boolean privilege_flag, long parentPostId){
        try{
            
            PreparedStatement pstmt;
            pstmt = conn.prepareStatement("select * from offering where offering_id = ?");
            pstmt.setLong(1, offering_id);
            ResultSet rset = pstmt.executeQuery();
            if (!(rset.next())){
                return 0;
            }
            
            pstmt = conn.prepareStatement("insert into post values(?, ?, ?, ?, ?, ?, ?)");
            pstmt.setString(1, null);
            if (parentPostId == -1){
                pstmt.setString(2, null);
            }
            else{
                pstmt.setLong(2, parentPostId);
            }
            pstmt.setString(3, student_id);
            pstmt.setLong(4, offering_id);
            pstmt.setTimestamp(5, null);
            pstmt.setString(6, content);
            pstmt.setBoolean(7, privilege_flag);

            pstmt.executeUpdate();

            if (parentPostId == -1){
                pstmt = conn.prepareStatement("select max(post_id) from post");
                rset = pstmt.executeQuery();
                long recentEntry = -1;
                if (rset.next()){
                    recentEntry = rset.getLong(1);
                }
                
                if (recentEntry != -1){
                    pstmt = conn.prepareStatement("update post set parent_post_id = ? where post_id = ?");
                    pstmt.setLong(1, recentEntry);
                    pstmt.setLong(2, recentEntry);
                    
                    pstmt.executeUpdate();
                }                
            }
            return 1;
            
        } catch (SQLException sqle) {
            System.out.println("SQLException : " + sqle);
            return 0;
        }        
    }