zoukankan      html  css  js  c++  java
  • 2020.12.7收获

    志愿者信息管理系统

    entity->Course.java

    package entity;
    
    public class Course {
    
        private int id;
        private String name;
        private String sex;
        private String minzu;
        private String time;
        private String age;
        private String mianmao;
        private String fuwu;
    
        public Course() {}
        
        public Course(int id, String name, String sex, String minzu,String time,String age,String mianmao,String fuwu) {
            this.setId(id);
            this.setName(name);
            this.setSex(sex);
            this.setMinzu(minzu);
            this.setTime(time);
            this.setAge(age);
            this.setMianmao(mianmao);
            this.setFuwu(fuwu);
        }
        
        public Course(String name, String sex, String minzu,String time,String age,String mianmao,String fuwu) {
            this.setName(name);
            this.setSex(sex);
            this.setMinzu(minzu);
            this.setTime(time);
            this.setAge(age);
            this.setMianmao(mianmao);
            this.setFuwu(fuwu);
        }
    
        public int getId() {
            return id;
        }
    
        public void setId(int id) {
            this.id = id;
        }
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        public String getSex() {
            return sex;
        }
    
        public void setSex(String sex) {
            this.sex = sex;
        }
    
        public String getMinzu() {
            return minzu;
        }
    
        public void setMinzu(String minzu) {
            this.minzu = minzu;
        }
        public String getTime() {
            return time;
        }
    
        public void setTime(String time) {
            this.time = time;
        }
        public String getAge() {
            return age;
        }
    
        public void setAge(String age) {
            this.age = age;
        }
        public String getMianmao() {
            return mianmao;
        }
    
        public void setMianmao(String mianmao) {
            this.mianmao = mianmao;
        }
        public String getFuwu() {
            return fuwu;
        }
    
        public void setFuwu(String fuwu) {
            this.fuwu = fuwu;
        }
    }

    util->DBUtil.java

    package util;
    
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    
    
    public class DBUtil {
        
        public static String db_url = "jdbc:mysql://localhost:3306/trycurd?useSSL=false&characterEncoding=UTF-8";
        public static String db_user = "root";
        public static String db_pass = "20183641";
        
        public static Connection getConn () {
            Connection conn = null;
            
            try {
                Class.forName("com.mysql.jdbc.Driver");
                conn = DriverManager.getConnection(db_url, db_user, db_pass);
            } catch (Exception e) {
                e.printStackTrace();
            }
            
            return conn;
        }
        
        
        public static void close (Statement state, Connection conn) {
            if (state != null) {
                try {
                    state.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
        
        public static void close (ResultSet rs, Statement state, Connection conn) {
            if (rs != null) {
                try {
                    rs.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            
            if (state != null) {
                try {
                    state.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
            
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
    
    }
  • 相关阅读:
    Windows API的CreateFile()中的OPEN_ALWAYS和CREATE_ALWAYS之间的差异
    Linux下的虚拟串口对(可用于在本机上模拟串口进行调试)
    [转&精]IO_STACK_LOCATION与IRP的一点笔记
    【转】在WIN7、WIN10操作系统用WebDAV映射网络驱动器需要的操作
    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information
    分布式处理大数据的目录及学习树
    利用docker将传统企业集中式架构转换为微服务架构的实践经验
    docker学习笔记5 端口映射与容器互联
    docker学习笔记4 数据管理、持久化
    docker学习笔记3 容器 container
  • 原文地址:https://www.cnblogs.com/ltw222/p/14171092.html
Copyright © 2011-2022 走看看