322323324325326327328329330331332
String driver = null; try { conn = ds.getConnection(); driver = identifyDriver(conn); } catch (Exception e) { throw new DbRuntimeException("Identify driver error!", e); }finally { close(conn); } return driver;
344345346347348349350351352353
driver = identifyDriver(meta.getDatabaseProductName()); if(StrUtil.isBlank(driver)) { driver = identifyDriver(meta.getDriverName()); } } catch (SQLException e) { throw new DbRuntimeException("Identify driver error!", e); } return driver; }
545556575859606162
*/ public Session(DataSource ds) { try { this.conn = ds.getConnection(); } catch (SQLException e) { throw new DbRuntimeException("Get connection error!", e); } this.runner = new SqlConnRunner(DialectFactory.newDialect(conn)); }
7879808182838485
this.pass = pass; this.driver = DbUtil.identifyDriver(url); try { Class.forName(this.driver); } catch (ClassNotFoundException e) { throw new DbRuntimeException(e, "Get jdbc driver from [{}] error!", url); } }