當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。