package com.example.leudaemialikeme.Dao;

import com.example.leudaemialikeme.Utils.DBUtils;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class InvitationDao {
    public boolean iInsert(int uid,String type,String title,String content,String time,int likeNum,int collectNum)throws Exception{
        Connection conn=null;
        Statement state=null;
        ResultSet rs=null;
        try{
            conn= DBUtils.getConnect();
            state=conn.createStatement();
            String sql="insert blog(uid,utype,utitle,ucontent,utime,ulikeNum,ucollectNum) values('"+
                    uid+"','"+type+"','"+title+"','"+content+"','"+time+"','"+likeNum+"','"+collectNum+"')";
            state.execute(sql);
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            DBUtils.release(conn,state,rs);
        }
        return true;
    }

}
