#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>