From c541e23b13fbd0c9a22ef325f2f9aff56329ff25 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 06 五月 2024 08:19:33 +0800
Subject: [PATCH] 修改数据库连接

---
 springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java |   64 ++++++++++++++++++++++++++++++-
 1 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java b/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
index ff51d9e..01bc770 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
@@ -18,7 +18,7 @@
 	 * 鏁版嵁搴撹繛鎺ュ弬鏁�
 	 * driver,url,username,password
 	 */
-	private static final String DRIVER = "com.mysql.jdbc.Driver";
+	private static final String DRIVER = "com.mysql.cj.jdbc.Driver";
 	private static final String URL = "jdbc:mysql://localhost:3306/canadames";
 	private static final String USERNAME = "root";
 	private static final String PASSWORD = "beibo.123/";
@@ -42,6 +42,64 @@
     }
 
 	public  north_glass_buffer1 SelectGlassByGlassIdOrderIdFrameId(String glassid,String orderid,String frameid) throws SQLException {
+        Connection conn = getConn();
+        north_glass_buffer1 north_glass_buffer1s=new north_glass_buffer1();
+        String sql = "select * from north_glass_buffer1 where barcode=? or ordernumber=? or FrameBarcode=?";
+         ps = conn.prepareStatement(sql);
+         ps.setString(1, glassid);
+		 ps.setString(2, orderid);
+		 ps.setString(3, frameid);
+         ResultSet rs= ps.executeQuery();
+         while (rs.next()) {
+			north_glass_buffer1s.setId(rs.getInt("Id"));
+			north_glass_buffer1s.setordernumber(rs.getString("ordernumber"));
+			north_glass_buffer1s.setlistnumber(rs.getString("listnumber"));
+			north_glass_buffer1s.setboxnumber(rs.getString("boxnumber"));
+			north_glass_buffer1s.setbarcode(rs.getString("barcode"));
+			north_glass_buffer1s.setglasslength(rs.getDouble("glasslength"));
+			north_glass_buffer1s.setglassheight(rs.getDouble("glassheight"));
+			north_glass_buffer1s.setglasslengthmm(rs.getDouble("glasslength_mm"));
+			north_glass_buffer1s.setglassheightmm(rs.getDouble("glassheight_mm"));
+			north_glass_buffer1s.setitemtype(rs.getString("itemtype"));
+			north_glass_buffer1s.setslotnumber(rs.getString("slotnumber"));
+			north_glass_buffer1s.setdatemodified(rs.getString("datemodified"));
+			north_glass_buffer1s.setdatecreated(rs.getString("datecreated"));
+			north_glass_buffer1s.setFrameBarcode(rs.getString("FrameBarcode"));
+         }
+		 conn.close();
+         return north_glass_buffer1s;
+    }
+
+	public  north_glass_buffer1 SelectGlassByGlassIdOrderIdFrameIdout(String glassid,String orderid,String frameid) throws SQLException {
+        Connection conn = getConn();
+        north_glass_buffer1 north_glass_buffer1s=new north_glass_buffer1();
+        String sql = "select * from north_glass_buffer1 where barcode=? or ordernumber=? or FrameBarcode=?";
+         ps = conn.prepareStatement(sql);
+         ps.setString(1, glassid);
+		 ps.setString(2, orderid);
+		 ps.setString(3, frameid);
+         ResultSet rs= ps.executeQuery();
+         while (rs.next()) {
+			north_glass_buffer1s.setId(rs.getInt("Id"));
+			north_glass_buffer1s.setordernumber(rs.getString("ordernumber"));
+			north_glass_buffer1s.setlistnumber(rs.getString("listnumber"));
+			north_glass_buffer1s.setboxnumber(rs.getString("boxnumber"));
+			north_glass_buffer1s.setbarcode(rs.getString("barcode"));
+			north_glass_buffer1s.setglasslength(rs.getDouble("glasslength"));
+			north_glass_buffer1s.setglassheight(rs.getDouble("glassheight"));
+			north_glass_buffer1s.setglasslengthmm(rs.getDouble("glasslength_mm"));
+			north_glass_buffer1s.setglassheightmm(rs.getDouble("glassheight_mm"));
+			north_glass_buffer1s.setitemtype(rs.getString("itemtype"));
+			north_glass_buffer1s.setslotnumber(rs.getString("slotnumber"));
+			north_glass_buffer1s.setdatemodified(rs.getString("datemodified"));
+			north_glass_buffer1s.setdatecreated(rs.getString("datecreated"));
+			north_glass_buffer1s.setFrameBarcode(rs.getString("FrameBarcode"));
+         }
+		 conn.close();
+         return north_glass_buffer1s;
+    }
+
+	public north_glass_buffer1 SelectGlassByGlassIdOrderIdFrameIdouts(String glassid,String orderid,String frameid) throws SQLException {
         Connection conn = getConn();
         north_glass_buffer1 north_glass_buffer1s=new north_glass_buffer1();
         String sql = "select * from north_glass_buffer1 where barcode=? or ordernumber=? or FrameBarcode=?";
@@ -286,8 +344,8 @@
 	 */
 	public static Connection getConn() throws SQLException {
 		Connection conn = null;
-		conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/canadames?serverTimezone=GMT%2B8&characterEncoding=utf-8", "root", "beibo.123/");
-		// conn = DriverManager.getConnection("jdbc:mysql://192.168.102.9:3306/production?serverTimezone=GMT%2B8&characterEncoding=utf-8", "northglass", "n0rthgla55");
+		// conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/canadames?serverTimezone=GMT%2B8&characterEncoding=utf-8", "root", "beibo.123/");
+		conn = DriverManager.getConnection("jdbc:mysql://192.168.102.9:3306/production?serverTimezone=GMT%2B8&characterEncoding=utf-8&useSSL=false", "northglass", "n0rthgla55");
 		return conn;
 	}
 

--
Gitblit v1.8.0