From 2a2306f5ea09976bc1efd7d3e8ddf14bec68791c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=94=90=E5=9B=BD=E4=BA=AE?= <647597435@qq.com>
Date: Fri, 26 May 2023 23:17:12 +0800
Subject: [PATCH] 20230526
---
.../20230524 \344\275\234\344\270\232.md" | 114 ++++++++++++++++++
1 file changed, 114 insertions(+)
create mode 100644 "19 \345\224\220\345\233\275\344\272\256/20230524 \344\275\234\344\270\232.md"
diff --git "a/19 \345\224\220\345\233\275\344\272\256/20230524 \344\275\234\344\270\232.md" "b/19 \345\224\220\345\233\275\344\272\256/20230524 \344\275\234\344\270\232.md"
new file mode 100644
index 0000000..3920361
--- /dev/null
+++ "b/19 \345\224\220\345\233\275\344\272\256/20230524 \344\275\234\344\270\232.md"
@@ -0,0 +1,114 @@
+```html
+
+
+
+
+ 学生管理系统
+
+
+
+
+
+
+
+
+```
+
+```java
+package com.dao;
+
+import java.sql.*;
+
+public class Dao {
+ private Connection conn;
+ private String driver = "com.mysql.jdbc.Driver";
+ private String url ="jdbc:mysql://localhost:3306/student_db?useSSL=false&useUnicode=true&charsetEnding=utf8";
+ private String user="root";
+ private String password="root";
+
+ public Dao() {
+ try {
+ Class.forName(driver);
+ System.out.println("驱动加载成功");
+ } catch (ClassNotFoundException e) {
+ System.out.println("驱动加载失败!");
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Connection getConn() {
+ try {
+ conn = DriverManager.getConnection(url,user,password);
+ System.out.println("数据库连接成功");
+ } catch (SQLException e) {
+ System.out.println("数据库连接失败!");
+ throw new RuntimeException(e);
+ }
+ return conn;
+ }
+
+ public void setConn(Connection conn) {
+ this.conn = conn;
+ }
+}
+```
+
+```java
+package com.student;
+
+public class Student {
+ private int id;
+ private String name;
+ private String sex;
+
+ public Student() {
+ }
+
+ public Student(int id, String name, String sex) {
+ this.id = id;
+ this.name = name;
+ this.sex = sex;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setSex(String sex) {
+ this.sex = sex;
+ }
+
+ @Override
+ public String toString() {
+ return "id= "+ id +" name= "+name+" sex= "+sex;
+ }
+}
+```
+
+```java
--
Gitee