wu
2023-11-27 ab458edbd053107077ae95acaca214ffb1d37828
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
@@ -9,6 +9,7 @@
import org.springframework.stereotype.Component;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.north_glass_buffer1;
@Component
public class JdbcConnections {
    /**
@@ -24,15 +25,15 @@
   private static PreparedStatement ps = null;
   private static ResultSet rs = null;
   
   public  Glass selectGlass(int glassid) throws SQLException {
   public  north_glass_buffer1 selectGlass(int glassid) throws SQLException {
        conn = getConn();
        Glass glass=new Glass();
        String sql = "select orderid from glass where glassid=?";
        north_glass_buffer1 glass=new north_glass_buffer1();
        String sql = "select ordernumber from north_glass_buffer1 where glassid=?";
         ps = conn.prepareStatement(sql);
         ps.setInt(1, glassid);
         rs= ps.executeQuery();
         while (rs.next()) {
         glass.setOrderId(rs.getShort("orderid"));
         glass.setordernumber(rs.getString("ordernumber"));
         }
       conn.close();
         return glass;
@@ -56,7 +57,7 @@
    */
   public static Connection getConn() throws SQLException {
      Connection conn = null;
      conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/canadameserp?serverTimezone=GMT%2B8&characterEncoding=utf-8", "root", "beibo.123/");
      conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/canadames?serverTimezone=GMT%2B8&characterEncoding=utf-8", "root", "beibo.123/");
      return conn;
   }