UnpooledDataSource每次实时获取connection 核心流程 UnpooledDataSource#getConnection(java.lang.String, java.lang.String) -> UnpooledDataSource#doGetConnection(java.lang.String, java.lang.String) 设置 props.setProperty("user", username); props.setProperty("password", password); -> UnpooledDataSource#doGetConnection(java.util.Properties)
初始化驱动:initializeDriver();
获取数据库连接:Connection connection = DriverManager.getConnection(url, properties);
设置连接属性:configureConnection(connection);
->
UnpooledDataSource#configureConnection
设置超时时间:使用了Executors.newSingleThreadExecutor()等待数据库操作完成
是否自动提交
隔离级别
标签:lang,java,String,getConnection,connection,UnpooledDataSource From: https://www.cnblogs.com/use-D/p/18152739