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


Java SQLClientInfoException类代码示例

本文整理汇总了Java中java.sql.SQLClientInfoException的典型用法代码示例。如果您正苦于以下问题:Java SQLClientInfoException类的具体用法?Java SQLClientInfoException怎么用?Java SQLClientInfoException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SQLClientInfoException类属于java.sql包,在下文中一共展示了SQLClientInfoException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setClientInfo

import java.sql.SQLClientInfoException; //导入依赖的package包/类
public void setClientInfo(String name, String value) throws SQLClientInfoException {
    try {
        checkClosed();

        ((java.sql.Connection) this.mc).setClientInfo(name, value);
    } catch (SQLException sqlException) {
        try {
            checkAndFireConnectionError(sqlException);
        } catch (SQLException sqlEx2) {
            SQLClientInfoException clientEx = new SQLClientInfoException();
            clientEx.initCause(sqlEx2);

            throw clientEx;
        }
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:17,代码来源:JDBC4ConnectionWrapper.java

示例2: setClientInfo

import java.sql.SQLClientInfoException; //导入依赖的package包/类
public void setClientInfo(Properties properties) throws SQLClientInfoException {
    try {
        checkClosed();

        ((java.sql.Connection) this.mc).setClientInfo(properties);
    } catch (SQLException sqlException) {
        try {
            checkAndFireConnectionError(sqlException);
        } catch (SQLException sqlEx2) {
            SQLClientInfoException clientEx = new SQLClientInfoException();
            clientEx.initCause(sqlEx2);

            throw clientEx;
        }
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:17,代码来源:JDBC4ConnectionWrapper.java

示例3: test11

import java.sql.SQLClientInfoException; //导入依赖的package包/类
/**
 * Validate that the ordering of the returned Exceptions is correct using
 * for-each loop
 */
@Test
public void test11() {
    SQLClientInfoException ex = new SQLClientInfoException("Exception 1",
            map, t1);
    SQLClientInfoException ex1 = new SQLClientInfoException("Exception 2",
            map);
    SQLClientInfoException ex2 = new SQLClientInfoException("Exception 3",
            map, t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:SQLClientInfoExceptionTests.java

示例4: setClientInfo

import java.sql.SQLClientInfoException; //导入依赖的package包/类
public synchronized void setClientInfo(java.sql.Connection conn, Properties properties) throws SQLClientInfoException {
    try {
        Enumeration<?> propNames = properties.propertyNames();

        while (propNames.hasMoreElements()) {
            String name = (String) propNames.nextElement();
            String value = properties.getProperty(name);

            setClientInfo(conn, name, value);
        }
    } catch (SQLException sqlEx) {
        SQLClientInfoException clientInfoEx = new SQLClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:18,代码来源:JDBC4ClientInfoProviderSP.java

示例5: isOkaySpecialCaseException

import java.sql.SQLClientInfoException; //导入依赖的package包/类
@Override
protected boolean isOkaySpecialCaseException(Method method, Throwable cause) {
  final boolean result;
  if (super.isOkaySpecialCaseException(method, cause)) {
    result = true;
  }
  else if (SQLClientInfoException.class == cause.getClass()
            && normalClosedExceptionText.equals(cause.getMessage())
            && (false
                || method.getName().equals("setClientInfo")
                || method.getName().equals("getClientInfo")
                )) {
    // Special good case--we had to use SQLClientInfoException from those.
    result = true;
  }
  else if (RuntimeException.class == cause.getClass()
           && normalClosedExceptionText.equals(cause.getMessage())
           && (false
               || method.getName().equals("getCatalog")
               || method.getName().equals("getSchema")
               )) {
    // Special good-enough case--we had to use RuntimeException for now.
    result = true;
  }
  else {
    result = false;
  }
  return result;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:30,代码来源:Drill2489CallsAfterCloseThrowExceptionsTest.java

示例6: setClientInfo

import java.sql.SQLClientInfoException; //导入依赖的package包/类
public void setClientInfo(
        Properties properties) throws SQLClientInfoException {

    try {
        validate();
    } catch (SQLException e) {
        throw new SQLClientInfoException(e.getMessage(), e.getSQLState(),
                e.getErrorCode(), (Map<String, ClientInfoStatus>) null, e);
    }
    this.getConnection().setClientInfo(properties);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:12,代码来源:BaseConnectionWrapper.java

示例7: test10

import java.sql.SQLClientInfoException; //导入依赖的package包/类
/**
 * Serialize a SQLClientInfoException and make sure you can read it back
 * properly
 */
@Test
public void test10() throws Exception {
    SQLClientInfoException e = new SQLClientInfoException(reason, state,
            errorCode, map, t);
    SQLClientInfoException ex1 =
            createSerializedException(e);
    assertTrue(reason.equals(ex1.getMessage())
            && ex1.getSQLState().equals(state)
            && cause.equals(ex1.getCause().toString())
            && ex1.getErrorCode() == errorCode
            && ex1.getFailedProperties().equals(map));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:SQLClientInfoExceptionTests.java

示例8: test8

import java.sql.SQLClientInfoException; //导入依赖的package包/类
/**
 * Create SQLClientInfoException with message, SQLState, and error code
 */
@Test
public void test8() {
    SQLClientInfoException ex = new SQLClientInfoException(reason, state,
            errorCode, map, t);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getSQLState().equals(state)
            && cause.equals(ex.getCause().toString())
            && ex.getErrorCode() == errorCode
            && ex.getFailedProperties().equals(map));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:SQLClientInfoExceptionTests.java

示例9: test7

import java.sql.SQLClientInfoException; //导入依赖的package包/类
/**
 * Create SQLClientInfoException with message, SQLState, errorCode, and
 * Throwable
 */
@Test
public void test7() {
    SQLClientInfoException ex = new SQLClientInfoException(reason, state,
            errorCode, map);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getSQLState().equals(state)
            && ex.getCause() == null
            && ex.getErrorCode() == errorCode
            && ex.getFailedProperties().equals(map));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:SQLClientInfoExceptionTests.java

示例10: test4

import java.sql.SQLClientInfoException; //导入依赖的package包/类
/**
 * Create SQLClientInfoException with null Throwable
 */
@Test
public void test4() {
    SQLClientInfoException ex = new SQLClientInfoException(reason, map, null);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getSQLState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0
            && ex.getFailedProperties().equals(map));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:SQLClientInfoExceptionTests.java

示例11: test3

import java.sql.SQLClientInfoException; //导入依赖的package包/类
/**
 * Create SQLClientInfoException with message
 */
@Test
public void test3() {
    SQLClientInfoException ex = new SQLClientInfoException(reason, map);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getSQLState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0
            && ex.getFailedProperties().equals(map));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:SQLClientInfoExceptionTests.java

示例12: setClientInfo

import java.sql.SQLClientInfoException; //导入依赖的package包/类
public void setClientInfo(Properties properties) throws SQLClientInfoException
{
	try
	{
		realConnection.setClientInfo(properties);
	}
	catch(SQLClientInfoException s)
	{
		String methodCall = "setClientInfo(" + properties + ")";
		reportException(methodCall, s, null);
		throw s;
	}
}
 
开发者ID:skeychen,项目名称:dswork.jdbc,代码行数:14,代码来源:ConnectionSpy.java

示例13: setClientInfo

import java.sql.SQLClientInfoException; //导入依赖的package包/类
public void setClientInfo(Properties properties) throws SQLClientInfoException {
    try {
        getClientInfoProviderImpl().setClientInfo(this, properties);
    } catch (SQLClientInfoException ciEx) {
        throw ciEx;
    } catch (SQLException sqlEx) {
        SQLClientInfoException clientInfoEx = new SQLClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
 
开发者ID:Jugendhackt,项目名称:OpenVertretung,代码行数:13,代码来源:JDBC4Connection.java

示例14: test5

import java.sql.SQLClientInfoException; //导入依赖的package包/类
/**
 * Create SQLClientInfoException with message, and SQLState
 */
@Test
public void test5() {
    SQLClientInfoException ex = new SQLClientInfoException(reason, state,
            map);

    assertTrue(ex.getMessage().equals(reason)
            && ex.getSQLState().equals(state)
            && ex.getCause() == null
            && ex.getErrorCode() == 0
            && ex.getFailedProperties().equals(map));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:SQLClientInfoExceptionTests.java

示例15: setClientInfo

import java.sql.SQLClientInfoException; //导入依赖的package包/类
public void setClientInfo(String name, String value) throws SQLClientInfoException {
    try {
        getClientInfoProviderImpl().setClientInfo(this, name, value);
    } catch (SQLClientInfoException ciEx) {
        throw ciEx;
    } catch (SQLException sqlEx) {
        SQLClientInfoException clientInfoEx = new SQLClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:13,代码来源:JDBC4Connection.java


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