zoukankan      html  css  js  c++  java
  • 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;
            }
    
    }
    


    效果图
    <ignore_js_op> 

    <ignore_js_op> 

    详细说明:http://java.662p.com/thread-3620-1-1.html

  • 相关阅读:
    博客园主题备份
    NT6 HDD Installer 3.1.3(硬盘直接重装Win7/Win8/Windows 2008系统)
    C# 自动投票和手机号码归属地查询 简单程序源码分享(高手飘过)
    Android 开发最简单的快速拨打器(含源码)
    学Android的开始
    Android 图片浏览器Gallery的简单应用
    WordPress设置定时发布文章,且发布之前无404可以正常访问(手动修改代码,无需插件)
    EJB3.0JPA实体的注解规范以及Hibernate特有的扩展
    验证码技术
    数据库索引
  • 原文地址:https://www.cnblogs.com/baiduandroidios/p/4252214.html
Copyright © 2011-2022 走看看