1
luxiaotao1123
2021-09-24 98610c8e9101b11678e6bc06bef2abfc45f5dc4c
src/main/java/com/zy/common/service/erp/ErpSqlServer.java
@@ -112,12 +112,13 @@
        return list;
    }
    private Connection getConn() {
        if (null == this.conn) {
    public synchronized Connection getConn() throws SQLException {
        if (null == this.conn || this.conn.isClosed()) {
            try {
                Class.forName(erpDbProperties.getDriver_class_name()).newInstance();
                this.conn = DriverManager.getConnection(erpDbProperties.getUr(), erpDbProperties.getUsername(), erpDbProperties.getPassword());
            } catch (Exception e) {
                log.error("获取ERP数据库连接失败");
                e.printStackTrace();
                throw new RuntimeException("获取ERP数据库连接失败");
            }