1.团队名称、团队成员
团队名称:秃头团队
成员 | 任务分配 |
---|---|
林小强(组长) | dao包 util包 可视化 |
陈泽役 | model包 可视化 |
2.前期调研
3.项目git地址
4.项目git提交记录截图
5.项目功能架构图与主要功能流程图
6.项目UML图
7.项目运行截图
8.项目关键代码(不能太多)
package util;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Connection;
public class JDBCUtil {
private static final String URL = "jdbc:mysql://localhost:3306/javadesign?useUnicode"
+ "=true&characterEncoding=utf-8&useSSL=false&serve" + "rTimezone = GMT";
private static final String USERNAME = "root";
private static final String PASSWORD = "123456";
public static Connection getConnection() throws SQLException {
Connection con = null;
con = DriverManager.getConnection(URL, USERNAME, PASSWORD);
return con;
}
}
package dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import models.Admin;
import util.JDBCUtil;
public class AdminDaoImpl implements AdminDao {
Connection con;
PreparedStatement sql;
ResultSet resultSet = null;
public Admin getAdminByAdminNumber(String adminNumber) {
Admin admin = null;
try {
con=JDBCUtil.getConnection();
sql = con.prepareStatement("select * from admin where adminnumber=?");
sql.setString(1, adminNumber);
resultSet = sql.executeQuery();
if (resultSet.next()) {
admin = new Admin(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3));
}
resultSet.close();
sql.close();
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return admin;
}
}
9.尚待改进或者新的想法
新的想法:学习一些网络编程技术实现联网点餐