| | |
| | | * 数据库连接参数 |
| | | * 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/"; |
| | |
| | | } |
| | | |
| | | 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=?"; |
| | |
| | | */ |
| | | 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; |
| | | } |
| | | |