2021/8//31

#8:30-9:00 签到打卡

#9:30-12:00 观看java视频

#14:00-18:00 写qq项目

1.数据库创建群

    public boolean addqun(String id,String name,String namber){
        Connection con = null;
        Statement st = null;
        Boolean s =null;
        try {
            Class.forName(driver);//注册驱动
            con = DriverManager.getConnection(url, "root", "123456");//获取连接
            st = con.createStatement();
            String s2 = "INSERT INTO qun (`群id`,`name`,`群成员`,`群主`) VALUES('"+id+"','"+name+"','"+namber+"','"+namber+"');";
            int i = st.executeUpdate(s2);
            if(i==1){
                return true;
            }
            else {
                return false;
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        } finally {
            if (con != null)
                try {
                    con.close();
                } catch (SQLException throwables) {
                    throwables.printStackTrace();
                }
            if (st != null)
                try {
                    st.close();
                } catch (SQLException throwables) {
                    throwables.printStackTrace();
                }
        }
        return s;
    }

2.服务器创建群mode

                }else if(m.getS().equals("30")){//创建群
                        Mysql my=new Mysql();
                        String ss=my.qun("1",m.getOid());
                        if(ss==null){
                            my.addqun(m.getOid(),m.getOname(),m.getMyid());
                            String s3=null;
                            FileOutputStream fos=null;
                            File fl=null;
                            for(int i=0;i<m.ss.size();i++)
                            {
                                if(s3!=m.ss.get(i)){
                                    s3=m.ss.get(i);
                                    fl=new File("src\\qqserver\\view\\"+s3+".jpg");
                                    fos=new FileOutputStream(fl.getCanonicalPath());
                                }
                                fos.write(m.ss2.get(i),0,m.ss1.get(i));
                            }
                            m.setS("31");
                            oos=new ObjectOutputStream(s.getOutputStream());
                        }else{//群已存在
                            m.setS("32");
                            oos=new ObjectOutputStream(s.getOutputStream());
                        }

3.html练习

<!DOCTYPE html> <!--约束 -->
    <html lang="en"><!--html的开始 -->
        <head> <!--头部信息-->
            <meta charset="UTF-8"> <!--表示使用utf-8字符集-->
            <title>立志的web</title><!--标题信息-->
        </head>
        <body><!--整个页面的主体部分-->
            <input type="checkbox"><!---->
        </body>
    <html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值