起航学习网

- 让每个人都能学到最前沿新知识、新技能!
起航学习网
当前位置: 起航学习网 > 短期培训 > 编程语言 > Java学生管理系统项目案例分析

Java学生管理系统项目案例分析

时间:2022-08-14 14:43:42来源:零基础学Java 作者:Java学习网 已有: 名学员访问该课程

  快捷搜索:Java项目案例分析

前言: 以下是Java学生管理系统项目的源码分析: package com.student.util; import java.sql.Connection;import java.sql.DriverManager;import java

以下是Java学生管理系统项目的源码分析:

package com.student.util; 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException; 
public class DbUtil {
        private String dbUrl="jdbc:mysql://localhost:3306/db_student";
        private String user="root";
        private String password="123456";
        private String jdbcName="com.mysql.jdbc.Driver";
        public Connection getCon() throws Exception{
                Class.forName(jdbcName);
                Connection con=DriverManager.getConnection(dbUrl, user, password);
                return con;
        }
        public void close(Connection con)throws Exception{
                if(con!=null){
                        con.close();
                }
        }
        public static void main(String[] args){
                Connection con=null;
                try {
                        con = new DbUtil().getCon();
                        System.out.println(con);
                } catch (Exception e) {
                        e.printStackTrace();
                }finally{
                        if(con!=null){
                                try {
                                        con.close();
                                } catch (SQLException e) {
                                        e.printStackTrace();
                                }
                        }
                }
        }
}
package com.student.model; 
public class Student {
        private int id;
        private String studentnumber;
        private String name;
        private String birthday;
        private String nativeplace;
        private int classid;
        private String studentremark;
        public Student() {
                super();
        }
        public Student(String studentnumber, String name, String birthday,
                        String nativeplace, int classid, String studentremark) {
                super();
                this.studentnumber = studentnumber;
                this.name = name;
                this.birthday = birthday;
                this.nativeplace = nativeplace;
                this.classid = classid;
                this.studentremark = studentremark;
        } 
        public Student(int id, String studentnumber, String name, String birthday,
                        String nativeplace, int classid, String studentremark) {
                super();
                this.id = id;
                this.studentnumber = studentnumber;
                this.name = name;
                this.birthday = birthday;
                this.nativeplace = nativeplace;
                this.classid = classid;
                this.studentremark = studentremark;
        } 
        public int getId() {
                return id;
        } 
        public void setId(int id) {
                this.id = id;
        } 
        public String getStudentnumber() {
                return studentnumber;
        }
        public void setStudentnumber(String studentnumber) {
                this.studentnumber = studentnumber;
        } 
        public String getName() {
                return name;
        } 
        public void setName(String name) {
                this.name = name;
        } 
        public String getBirthday() {
                return birthday;
        } 
        public void setBirthday(String birthday) {
                this.birthday = birthday;
        } 
        public String getNativeplace() {
                return nativeplace;
        } 
        public void setNativeplace(String nativeplace) {
                this.nativeplace = nativeplace;
        } 
        public int getClassid() {
                return classid;
        }
         public void setClassid(int classid) {
                this.classid = classid;
        } 
        public String getStudentremark() {
                return studentremark;
        } 
        public void setStudentremark(String studentremark) {
                this.studentremark = studentremark;
        } 
}

 

文章出自:http://qh.itpxw.cn/peixun/software/2022123691.html

文章标题:Java学生管理系统项目案例分析



免责声明:本站文章均由入驻起航学习网的会员所发或者网络转载,所述观点仅代表作者本人,不代表起航学习网立场。如有侵权或者其他问题,请联系举报,必删。侵权投诉

你也许会喜欢如下的文章?
(责任编辑:深圳学历教育网)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
培训学校
IT培训网 访问该机构站点 报名留言 加为好友 用户等级:注册会员 用户级别:10 机构名称:IT培训网 联 系 人:罗老师 联系电话:13783581536 联系手机:13783581536 在线客服:起航学习网客服 在 线 QQ:起航学习网客服 电子邮件: 网站域名:http://www.itpxw.cn 注册时间:2016-07-18 11:07 最后登录:2024-02-20 13:02
推荐内容