我正在使用shell/perl搜索一个不应该包含此字符串"section"的文件.
grep -vl如果字符串存在,请帮我找到way 命令返回文件名.
我想知道isWrapperFor在JDBC中验证和解包函数的正确方法.这里HIRAConnection使用标准Connection类.
HIRAConnection hiraCon1 = (HIRAConnection) ds.getConnection();
Connection conn = ds.getConnection();
if (hiraCon1 instanceof Wrapper) {
// try to use java 6 unwrapping
try {
Wrapper w = conn;
if (hiraCon1.isWrapperFor(Connection.class)) {
hiraCon1 = conn.unwrap(HIRAConnection.class);
hiraCon1= hiraCon1.unwrap(HIRAConnection.class);
hiraCon1= ds.unwrap(HIRAConnection.class);//returns SQLException
}
if (hiraCon1.isWrapperFor(HIRAConnection.class)) {
hiraCon1 = conn.unwrap(HIRAConnection.class);
hiraCon1 = hiraCon1.unwrap(HIRAConnection.class);
}
if (conn.isWrapperFor(com.hira.HIRAConnection.class)) {
hiraCon1 = conn.unwrap(com.hira.HIRAConnection.class);
}
if (conn.isWrapperFor(Connection.class)) {
hiraCon1 = conn.unwrap(com.hira.HIRAConnection.class);
}
} catch (Throwable t) {
System.out.println("Failed to unwrap connection using …Run Code Online (Sandbox Code Playgroud)