資源簡介
基于Mysql數(shù)據(jù)庫的模仿騰訊QQ通訊軟件,實現(xiàn)了一對一與群聊功能,界面高仿。

代碼片段和文件信息
package?com.dao;
import?java.sql.Connection;
import?java.sql.PreparedStatement;
import?java.sql.ResultSet;
import?java.sql.ResultSetmetaData;
import?java.sql.SQLException;
import?java.sql.Statement;
import?java.util.ArrayList;
import?java.util.HashMap;
import?java.util.Iterator;
import?java.util.List;
import?com.qqServer.Group;
import?com.qqServer.MySqlConn;
import?com.qqServer.User;
import?com.qqServer.UserIFC;
public?class?MySQLUserDao?implements?UserIFC?{
private?static?MySQLUserDao?oracleUserDao;
private?MySQLUserDao()?{
}
public?static?MySQLUserDao?getInstance()?{
if?(oracleUserDao?==?null)
oracleUserDao?=?new?MySQLUserDao();
return?oracleUserDao;
}
public?boolean?setOnline(String?id?int?isOnline)?{
Connection?conn?=?MySqlConn.getConnection();
PreparedStatement?pst?=?null;
try?{
pst?=?conn.prepareStatement(“UPDATE?USERS?SET?U_isOnline?=???WHERE?U_qq?=??“);
pst.setInt(1?isOnline);
pst.setString(2?id);
if?(pst.executeUpdate()?>?0)?{
return?true;
}
return?false;
}?catch?(SQLException?e)?{
e.printStackTrace();
}?finally?{
if?(pst?!=?null)?{
try?{
pst.close();
}?catch?(SQLException?e1)?{
}
}
}
return?false;
}
public?boolean?delete(String?id)?{
Connection?conn?=?MySqlConn.getConnection();
PreparedStatement?pst?=?null;
try?{
pst?=?conn.prepareStatement(“DELETE?FROM?USERS?WHERE?U_qq?=??“);
pst.setString(1?id);
if?(pst.executeUpdate()?>?0)?{
return?true;
}
}?catch?(SQLException?e)?{
e.printStackTrace();
}?finally?{
if?(pst?!=?null)?{
try?{
pst.close();
}?catch?(SQLException?e1)?{
}
}
}
return?false;
}
public?boolean?update(User?user)?{
Connection?conn?=?MySqlConn.getConnection();
PreparedStatement?pst?=?null;
String?sql?=?“UPDATE?USERS?SET?U_name=?“
+?“U_photoID=?“
+?“WHERE?U_qq=?“;
try?{
pst?=?conn.prepareStatement(sql);
pst.setString(1?user.getName().trim());
pst.setInt(2?user.getIconId());
pst.setString(3?user.getId().trim());
if?(pst.executeUpdate()?>?0)?{
return?true;
}
return?false;
}?catch?(SQLException?e)?{
e.printStackTrace();
}?finally?{
if?(pst?!=?null)?{
try?{
pst.close();
}?catch?(SQLException?e1)?{
}
}
}
return?false;
}
public?boolean?add(User?user)?{
Connection?conn?=?MySqlConn.getConnection();
PreparedStatement?pst?=?null;
String?sql?=?“INSERT?INTO?USERS(U_qqU_nameU_pwdU_photoIDU_isOnline)“
+?“VALUES(?????)“;
try?{
pst?=?conn.prepareStatement(sql);
pst.setString(1?user.getId());
pst.setString(2?user.getName());
pst.setString(3?“123456“);
pst.setInt(4?user.getIconId());
pst.setInt(5?0);
if?(pst.executeUpdate()?>?0)?{
return?true;
}
return?false;
}?catch?(SQLException?e)?{
e.printStackTrace();
}?finally?{
if?(pst?!=?null)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-06-19?10:08??仿QQ聊天系統(tǒng)\
?????文件????????2462??2018-06-19?10:08??仿QQ聊天系統(tǒng)\qq.sql
?????目錄???????????0??2018-06-21?16:24??仿QQ聊天系統(tǒng)\qqServerV2.0\
?????文件?????????310??2018-06-12?15:50??仿QQ聊天系統(tǒng)\qqServerV2.0\.classpath
?????文件?????????388??2018-06-21?16:25??仿QQ聊天系統(tǒng)\qqServerV2.0\.project
?????目錄???????????0??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\
?????目錄???????????0??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\
?????目錄???????????0??2018-06-22?11:09??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\dao\
?????文件????????9752??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\dao\MySQLUserDao.class
?????目錄???????????0??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\pack\
?????文件?????????538??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\pack\Message.class
?????文件????????1292??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\pack\MessagePack.class
?????文件????????1726??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\pack\Myob
?????文件?????????855??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\pack\Myob
?????文件?????????371??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\pack\PackInterface.class
?????文件????????5600??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\pack\PackOper.class
?????目錄???????????0??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\
?????文件????????7388??2018-06-22?11:12??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\ClientThread.class
?????文件????????1259??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\Group.class
?????文件????????1667??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\MessageServer.class
?????文件????????1932??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\MySqlConn.class
?????文件?????????410??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\Parameter.class
?????文件????????2580??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\PubToolkit.class
?????文件????????2501??2018-06-22?11:13??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\PubValue.class
?????文件????????1314??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\ServerMain.class
?????文件?????????941??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\ServerUi$1.class
?????文件????????3181??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\ServerUi.class
?????文件????????2025??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\User.class
?????文件?????????545??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\qqServer\UserIFC.class
?????目錄???????????0??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\Serverimage\
?????文件????????1244??2018-06-22?10:41??仿QQ聊天系統(tǒng)\qqServerV2.0\bin\com\Serverimage\GetImage.class
............此處省略200個文件信息
- 上一篇:Android靜默拍照
- 下一篇:天地圖開發(fā)
評論
共有 條評論