当前位置: 首页 > news >正文

哈尔滨如何免费制作网站汇鑫网站建设方便

哈尔滨如何免费制作网站,汇鑫网站建设方便,网站内链建设锚文字建设,网站的页面布局一、项目概述 本学生管理系统旨在提供一个方便的界面,用于学校或机构管理学生信息,包括学生基本信息、课程成绩等。 二、系统架构 系统采用经典的三层架构,包括前端使用JavaSwing,后端采用Java Servlet,数据库使用M…

一、项目概述

本学生管理系统旨在提供一个方便的界面,用于学校或机构管理学生信息,包括学生基本信息、课程成绩等。

二、系统架构

系统采用经典的三层架构,包括前端使用JavaSwing,后端采用Java Servlet,数据库使用MySQL。

三、技术选型

  • JavaSwing作为前端UI框架。
  • Java Servlet处理后端逻辑。
  • MySQL数据库存储学生信息。

四、安装和配置

  1. 下载项目源代码。
  2. 安装Java Development Kit (JDK)。
  3. 设置数据库连接配置。
  4. 运行系统初始化脚本。

1.学生信息管理

  1. 在主界面选择“学生管理”。
  2. 点击“添加学生”按钮,输入学生信息。
  3. 查看学生列表和详细信息。

2.成绩管理

  1. 进入“成绩管理”模块。
  2. 选择课程和学生,输入成绩。
  3. 查看成绩报表。

五、数据库设计

student

  • sid:学生ID,自增长。
  • sname:学生姓名。
  • snumber:学号。
  • sage:学生年龄。
  • sphone:学生电话。
  • saddress:学生地址。

示例数据:

sidsnamesnumbersagesphonesaddress
1styhs1234567892312345678郑州

user

  • uid:用户ID,自增长。
  • uname:用户名。
  • upassword:用户密码。

示例数据:

uidunameupassword
1user123456
2user1111111
3user2111111

六、程序截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

七、代码

DBUtil.java

package studentapp.dal;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;public class DBUtil {private static String driver = "com.mysql.jdbc.Driver";private static String URL = "jdbc:mysql://localhost:3306/studentdb?useSSL=false";private static Connection con = null;private static Statement smt = null;private static ResultSet rs = null;private static Connection createConnection() {try {Class.forName(driver);return DriverManager.getConnection(URL, "root", "");} catch (SQLException e) {System.out.println(e.getMessage());e.printStackTrace();} catch (java.lang.ClassNotFoundException e) {System.out.println("Can't load Driver");}return null;}public static int runUpdate(String sql) throws SQLException {int count = 0;if (con == null) {con = createConnection();}if (smt == null) {smt = con.createStatement();}count = smt.executeUpdate(sql);if (smt != null) {smt.close();smt = null;}if (con != null) {con.close();con = null;}return count;}public static ResultSet runQuery(String sql) throws SQLException {if (con == null) {con = createConnection();}if (smt == null) {smt = con.createStatement();}return smt.executeQuery(sql);}public static void realeaseAll() {if (rs != null) {try {rs.close();rs = null;} catch (SQLException e) {e.printStackTrace();}}if (smt != null) {try {smt.close();smt = null;} catch (SQLException e) {e.printStackTrace();}}if (con != null) {try {con.close();con = null;} catch (SQLException ex) {Logger.getLogger(DBUtil.class.getName()).log(Level.SEVERE, null, ex);}}}public static void closeConnection(Connection conn) {System.out.println("...");try {if (conn != null) {conn.close();conn = null;}} catch (SQLException e) {e.printStackTrace();}}
}

LoginJFrame.java

package studentapp.gui;import java.awt.BorderLayout;
import java.awt.EventQueue;import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;import studentapp.dal.Entity.User;
import studentapp.dal.daoimpl.UserDaoImpl;import java.awt.CardLayout;
import java.awt.Event;import javax.swing.JTextField;
import java.awt.FlowLayout;
import javax.swing.JPasswordField;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JMenu;
import javax.swing.SwingConstants;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;public class LoginJFrame extends JFrame {private JPanel contentPane;private JTextField userName;private JPasswordField userPassword;private JTextField adminName;private JPasswordField adminPassword;/*** Launch the application.*/public static void main(String[] args) {EventQueue.invokeLater(new Runnable() {public void run() {try {LoginJFrame frame = new LoginJFrame();frame.setVisible(true);} catch (Exception e) {e.printStackTrace();}}});}/*** Create the frame.*/public LoginJFrame() {setTitle("\u767B\u9646\u5B66\u751F\u7BA1\u7406\u7CFB\u7EDF");setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setBounds(100, 100, 450, 300);CardLayout cardLayout=new CardLayout();JMenuBar menuBar = new JMenuBar();setJMenuBar(menuBar);JMenu landingOptions = new JMenu("\u767B\u9646\u9009\u62E9");menuBar.add(landingOptions);JMenuItem adminOption = new JMenuItem("\u7BA1\u7406\u5458\u767B\u9646");adminOption.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {cardLayout.last(contentPane);}});landingOptions.add(adminOption);JMenuItem userOption = new JMenuItem("\u7528\u6237\u767B\u9646");userOption.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent arg0) {cardLayout.first(contentPane);}});landingOptions.add(userOption);contentPane = new JPanel();contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));setContentPane(contentPane);contentPane.setLayout(cardLayout);JPanel userPanel = new JPanel();contentPane.add(userPanel, "name_5600414879778");userPanel.setLayout(null);userName = new JTextField();userName.setBounds(148, 55, 122, 21);userPanel.add(userName);userName.setColumns(10);userPassword = new JPasswordField();userPassword.setBounds(148, 96, 122, 21);userPanel.add(userPassword);JButton userButton1 = new JButton("\u767B\u9646");userButton1.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent event) {userLoginActionPerformed(event);}});userButton1.setBounds(72, 159, 93, 23);userPanel.add(userButton1);JButton userButton2 = new JButton("\u6CE8\u518C");userButton2.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent event) {userRegisterActionPerformed(event);}});userButton2.setBounds(220, 159, 93, 23);userPanel.add(userButton2);JLabel lbll = new JLabel("\u7528\u6237\u540D\uFF1A");lbll.setBounds(72, 58, 54, 15);userPanel.add(lbll);JLabel label = new JLabel("\u5BC6\u7801\uFF1A");label.setBounds(72, 99, 54, 15);userPanel.add(label);JPanel adminPanel = new JPanel();contentPane.add(adminPanel, "name_5642638031832");adminPanel.setLayout(null);adminName = new JTextField();adminName.setBounds(190, 48, 129, 21);adminPanel.add(adminName);adminName.setColumns(10);adminPassword = new JPasswordField();adminPassword.setBounds(190, 91, 129, 21);adminPanel.add(adminPassword);JButton adminButton = new JButton("\u767B\u9646");adminButton.setBounds(152, 151, 93, 23);adminPanel.add(adminButton);JLabel lblNewLabel = new JLabel("\u7BA1\u7406\u5458\u540D\uFF1A");lblNewLabel.setBounds(79, 51, 101, 15);adminPanel.add(lblNewLabel);JLabel lblNewLabel_1 = new JLabel("\u7BA1\u7406\u5458\u5BC6\u7801\uFF1A");lblNewLabel_1.setBounds(79, 94, 101, 15);adminPanel.add(lblNewLabel_1);}private void userLoginActionPerformed(ActionEvent event) {String uname=userName.getText();String upassword=userPassword.getText();UserDaoImpl userDaoImpl=new UserDaoImpl();if(userDaoImpl.certifyUser(uname, upassword)){JOptionPane.showMessageDialog(this, "��¼�ɹ�");StudentJFrame studentJFrame=new StudentJFrame();studentJFrame.setBounds(600, 400, 800, 600);studentJFrame.setVisible(true);this.setVisible(false);this.dispose();}else{JOptionPane.showMessageDialog(this, "��¼ʧ�ܣ��˺Ż��������","��½ѧ������ϵͳ",JOptionPane.ERROR_MESSAGE);}}private void userRegisterActionPerformed(ActionEvent event) {String uname=userName.getText();String upassword=userPassword.getText();User user=new User(uname,upassword);UserDaoImpl userDaoImpl=new UserDaoImpl();if(userDaoImpl.addUser(user)) {JOptionPane.showMessageDialog(this, "ע��ɹ�");}else {JOptionPane.showMessageDialog(this, "ע��ʧ��!","ע��ѧ������ϵͳ",JOptionPane.ERROR_MESSAGE);}}}

SimpleTableModel.java


package studentapp.gui;import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.AbstractTableModel;import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils.Collections;import studentapp.dal.Entity.Student;public  class SimpleTableModel<T> extends AbstractTableModel
{protected List<String> cols;protected List<T> rows;public SimpleTableModel(List<String> cols, List<T> rows) {this.cols = cols;this.rows = rows;}public List<String> getCols() {return cols;}public void setCols(List<String> cols) {this.cols = cols;}public List<T> getRows() {return rows;}public void setRows(List<T> rows) {this.rows = rows;}@Overridepublic int getRowCount() {return rows.size();}@Overridepublic int getColumnCount() {return  cols.size();}@Overridepublic String getColumnName(int column) {return cols.get(column);}@Overridepublic  Object getValueAt(int rowIndex, int columnIndex) {try {List<Method> getMethods=ClassRefect.getAllGetMethod(rows.get(rowIndex));          return getMethods.get(columnIndex).invoke(rows.get(rowIndex), null);} catch (IllegalAccessException ex) {Logger.getLogger(SimpleTableModel.class.getName()).log(Level.SEVERE, null, ex);} catch (IllegalArgumentException ex) {Logger.getLogger(SimpleTableModel.class.getName()).log(Level.SEVERE, null, ex);} catch (InvocationTargetException ex) {Logger.getLogger(SimpleTableModel.class.getName()).log(Level.SEVERE, null, ex);}return "";}}

八、交流与联系

q:969060742 文档、代码、sql、程序资源
http://www.yayakq.cn/news/509542/

相关文章:

  • 网站架构设计师有哪些学校可以报考怎么给企业制作网站
  • 商城模板建站价格哈尔滨关键词优化平台
  • jetty网站开发城乡与建设厅网站首页
  • 柳州哪家网站建设专业wordpress图片文件目录下
  • 企业网站快速建站装修公司需要什么资质
  • 网站模板如何用展厅设计说明
  • 站群建站系统昆明网站建设哪个公司好
  • 做网站开发要具备什么知识简单的微信小程序项目
  • 河北网站建设报价云彩网站
  • 房产网站建设什么类型哪个网站做的效果图好
  • 网站域名登陆地址查询网络市场营销的概念
  • 陕西建设网综合便民服务中心网站灯塔网站建设
  • 上海谷歌seo公司优化科技
  • 做期货黄金哪个网站信息数据准微信公众平台小程序怎么用
  • 常用的网站语言外贸推广哪家好
  • 如何看网站是用什么程序做的服装网站源码php
  • 解释seo网站推广如何做医美机构网站观察分析
  • 珠海企业网站建设商务网站建设怎样收费
  • 网站上传视频教程网站开发笔记本要什么配置
  • 国内虚拟助手网站手机网站的制作
  • 域名 网址 网站名称百度seo优化是什么意思
  • 自己做的网站图片打开慢石家庄长安区网站建设公司
  • 美味西式餐饮美食网站模板云南建设注册考试中心网站
  • 织梦文章类网站模板公众号制作135
  • 中华建设杂志网站网站建设 6万元
  • 网站域名不备案浏阳seo
  • 成都网站建设代理加盟网站建设报价浩森宇特
  • 龙华网站-建设深圳信科拓者室内设计联盟
  • 网站设计与开发专业app需要网站有哪些
  • 学做网站丛什么开始花生壳免费域名注册网站