当前位置: 首页>>代码示例>>Java>>正文


Java MysqlValidConnectionChecker类代码示例

本文整理汇总了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()));
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:25,代码来源:DataSourceRegressionTest.java

示例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()));
    }
}
 
开发者ID:mniepert,项目名称:TPKB,代码行数:23,代码来源:DataSourceRegressionTest.java

示例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()));
	}	
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:22,代码来源:DataSourceRegressionTest.java

示例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);
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:8,代码来源:ConnectionRegressionTest.java

示例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);
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:6,代码来源:ConnectionRegressionTest.java


注:本文中的com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。