本文整理汇总了Java中com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker类的典型用法代码示例。如果您正苦于以下问题:Java MysqlValidConnectionChecker类的具体用法?Java MysqlValidConnectionChecker怎么用?Java MysqlValidConnectionChecker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MysqlValidConnectionChecker类属于com.mysql.jdbc.integration.jboss包,在下文中一共展示了MysqlValidConnectionChecker类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBug20242
import com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker; //导入依赖的package包/类
/**
* Tests fix for BUG#20242 - MysqlValidConnectionChecker for JBoss doesn't
* work with MySQLXADataSources.
*
* @throws Exception
* if the test fails.
*/
public void testBug20242() throws Exception {
if (versionMeetsMinimum(5, 0)) {
try {
Class.forName("org.jboss.resource.adapter.jdbc.ValidConnectionChecker");
} catch (Exception ex) {
System.out.println("The testBug20242() is ignored because required class isn't available:");
ex.printStackTrace();
return; // class not available for testing
}
MysqlXADataSource xaDs = new MysqlXADataSource();
xaDs.setUrl(dbUrl);
MysqlValidConnectionChecker checker = new MysqlValidConnectionChecker();
assertNull(checker.isValidConnection(xaDs.getXAConnection().getConnection()));
}
}
示例2: testBug20242
import com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker; //导入依赖的package包/类
/**
* Tests fix for BUG#20242 - MysqlValidConnectionChecker for JBoss doesn't
* work with MySQLXADataSources.
*
* @throws Exception
* if the test fails.
*/
public void testBug20242() throws Exception {
if (versionMeetsMinimum(5, 0)) {
try {
Class.forName("org.jboss.resource.adapter.jdbc.ValidConnectionChecker");
} catch (Exception ex) {
return; // class not available for testing
}
MysqlXADataSource xaDs = new MysqlXADataSource();
xaDs.setUrl(dbUrl);
MysqlValidConnectionChecker checker = new MysqlValidConnectionChecker();
assertNull(checker.isValidConnection(xaDs.getXAConnection().getConnection()));
}
}
示例3: testBug20242
import com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker; //导入依赖的package包/类
/**
* Tests fix for BUG#20242 - MysqlValidConnectionChecker for JBoss doesn't
* work with MySQLXADataSources.
*
* @throws Exception if the test fails.
*/
public void testBug20242() throws Exception {
if (versionMeetsMinimum(5, 0)) {
try {
Class.forName("org.jboss.resource.adapter.jdbc.ValidConnectionChecker");
} catch (Exception ex) {
return; // class not available for testing
}
MysqlXADataSource xaDs = new MysqlXADataSource();
xaDs.setUrl(dbUrl);
MysqlValidConnectionChecker checker = new MysqlValidConnectionChecker();
assertNull(checker.isValidConnection(xaDs.getXAConnection().getConnection()));
}
}
示例4: testBug29106
import com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker; //导入依赖的package包/类
public void testBug29106() throws Exception {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class<?> checkerClass = cl
.loadClass("com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker");
((MysqlValidConnectionChecker) checkerClass.newInstance())
.isValidConnection(this.conn);
}
示例5: testBug29106
import com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker; //导入依赖的package包/类
public void testBug29106() throws Exception {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class<?> checkerClass = cl.loadClass("com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker");
((MysqlValidConnectionChecker) checkerClass.newInstance()).isValidConnection(this.conn);
}