赞
踩
- private static ThreadLocal<Connection> connectionHolder
- =new ThreadLocal<Connection>(){
- public Connection initialVlaue(){
- return DriverManager.getConnection(DB_URL);
- }
- }
- public static Connection getConnection(){
- return connectionHolder.get();
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。