
sf.database.connection.ConnectionHelp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sorm Show documentation
Show all versions of sorm Show documentation
java jpa tool for spring
The newest version!
package sf.database.connection;
import java.sql.Connection;
public class ConnectionHelp {
// private static boolean druidExist = ClassUtils.isPresent("com.alibaba.druid.pool.DruidPooledConnection", ConnectionHelp.class.getClassLoader());
/**
* 还原为原始连接
* @param wrap
* @return
*/
public static Connection getPhysicalConnection(Connection wrap) {
// if (druidExist) {
// if (wrap instanceof com.alibaba.druid.pool.DruidPooledConnection) {
// com.alibaba.druid.pool.DruidPooledConnection dpc = (com.alibaba.druid.pool.DruidPooledConnection) wrap;
// try {
// return dpc.unwrap(Connection.class);
// } catch (SQLException e) {
// throw new RuntimeException(e);
// }
// }
// }
return wrap;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy