微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java.sql.SQLClientInfoException的实例源码

项目:ProyectoPacientes    文件JDBC4ConnectionWrapper.java   
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;
        }
    }
}
项目:the-vigilantes    文件JDBC4ConnectionWrapper.java   
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;
        }
    }
}
项目:the-vigilantes    文件JDBC4ConnectionWrapper.java   
public void setClientInfo(String name,value);
    } catch (sqlException sqlException) {
        try {
            checkAndFireConnectionError(sqlException);
        } catch (sqlException sqlEx2) {
            sqlClientInfoException clientEx = new sqlClientInfoException();
            clientEx.initCause(sqlEx2);

            throw clientEx;
        }
    }
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * 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",t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:BibliotecaPS    文件JDBC4ConnectionWrapper.java   
public void setClientInfo(String name,value);
    } catch (sqlException sqlException) {
        try {
            checkAndFireConnectionError(sqlException);
        } catch (sqlException sqlEx2) {
            sqlClientInfoException clientEx = new sqlClientInfoException();
            clientEx.initCause(sqlEx2);

            throw clientEx;
        }
    }
}
项目:OpenVertretung    文件JDBC4ConnectionWrapper.java   
public void setClientInfo(String name,value);
    } catch (sqlException sqlException) {
        try {
            checkAndFireConnectionError(sqlException);
        } catch (sqlException sqlEx2) {
            sqlClientInfoException clientEx = new sqlClientInfoException();
            clientEx.initCause(sqlEx2);

            throw clientEx;
        }
    }
}
项目:ProyectoPacientes    文件JDBC4ClientInfoProviderSP.java   
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;
    }
}
项目:BibliotecaPS    文件JDBC4ConnectionWrapper.java   
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;
        }
    }
}
项目:lams    文件JDBC4ConnectionWrapper.java   
public void setClientInfo(String name,value);
    } catch (sqlException sqlException) {
        try {
            checkAndFireConnectionError(sqlException);
        } catch (sqlException sqlEx2) {
            sqlClientInfoException clientEx = new sqlClientInfoException();
            clientEx.initCause(sqlEx2);

            throw clientEx;
        }
    }
}
项目:dremio-oss    文件Drill2489CallsAfterCloseThrowExceptionsTest.java   
@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;
}
项目:sstore-soft    文件BaseConnectionWrapper.java   
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);
}
项目:openjdk-jdk10    文件sqlClientInfoExceptionTests.java   
/**
 * 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,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));
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException with message,sqlState,and error code
 */
@Test
public void test8() {
    sqlClientInfoException ex = new sqlClientInfoException(reason,t);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getsqlState().equals(state)
            && cause.equals(ex.getCause().toString())
            && ex.getErrorCode() == errorCode
            && ex.getFailedProperties().equals(map));
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException with message,and
 * Throwable
 */
@Test
public void test7() {
    sqlClientInfoException ex = new sqlClientInfoException(reason,map);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getsqlState().equals(state)
            && ex.getCause() == null
            && ex.getErrorCode() == errorCode
            && ex.getFailedProperties().equals(map));
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException with null Throwable
 */
@Test
public void test4() {
    sqlClientInfoException ex = new sqlClientInfoException(reason,null);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getsqlState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0
            && ex.getFailedProperties().equals(map));
}
项目:openjdk-jdk10    文件sqlClientInfoExceptionTests.java   
/**
 * 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));
}
项目:dswork.jdbc    文件ConnectionSpy.java   
public void setClientInfo(Properties properties) throws sqlClientInfoException
{
    try
    {
        realConnection.setClientInfo(properties);
    }
    catch(sqlClientInfoException s)
    {
        String methodCall = "setClientInfo(" + properties + ")";
        reportException(methodCall,s,null);
        throw s;
    }
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * Serialize a sqlClientInfoException and make sure you can read it back
 * properly
 */
@Test
public void test10() throws Exception {
    sqlClientInfoException e = new sqlClientInfoException(reason,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));
}
项目:OpenVertretung    文件JDBC4Connection.java   
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;
    }
}
项目:openjdk-jdk10    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException with message,and sqlState
 */
@Test
public void test5() {
    sqlClientInfoException ex = new sqlClientInfoException(reason,map);

    assertTrue(ex.getMessage().equals(reason)
            && ex.getsqlState().equals(state)
            && ex.getCause() == null
            && ex.getErrorCode() == 0
            && ex.getFailedProperties().equals(map));
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * 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));
}
项目:openjdk-jdk10    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException with message,map);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getsqlState().equals(state)
            && ex.getCause() == null
            && ex.getErrorCode() == errorCode
            && ex.getFailedProperties().equals(map));
}
项目:ProyectoPacientes    文件JDBC4Connection.java   
public void setClientInfo(String name,String value) throws sqlClientInfoException {
    try {
        getClientInfoProviderImpl().setClientInfo(this,value);
    } catch (sqlClientInfoException ciEx) {
        throw ciEx;
    } catch (sqlException sqlEx) {
        sqlClientInfoException clientInfoEx = new sqlClientInfoException();
        clientInfoEx.initCause(sqlEx);

        throw clientInfoEx;
    }
}
项目:openjdk-jdk10    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException with message,and sqlState
 */
@Test
public void test6() {
    sqlClientInfoException ex = new sqlClientInfoException(reason,t);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getsqlState().equals(state)
            && cause.equals(ex.getCause().toString())
            && ex.getErrorCode() == 0
            && ex.getFailedProperties().equals(map));
}
项目:dswork.jdbc    文件ConnectionSpy.java   
public void setClientInfo(String name,String value) throws sqlClientInfoException
{
    try
    {
        realConnection.setClientInfo(name,value);
    }
    catch(sqlClientInfoException s)
    {
        String methodCall = "setClientInfo(" + name + "," + value + ")";
        reportException(methodCall,null);
        throw s;
    }
}
项目:lams    文件JDBC4Connection.java   
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;
    }
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException and setting all objects to null
 */
@Test
public void test() {
    sqlClientInfoException e = new sqlClientInfoException(null);
    assertTrue(e.getMessage() == null && e.getsqlState() == null
            && e.getCause() == null && e.getErrorCode() == 0
            && e.getFailedProperties() == null);
}
项目:dswork    文件ConnectionSpy.java   
public void setClientInfo(Properties properties) throws sqlClientInfoException
{
    try
    {
        realConnection.setClientInfo(properties);
    }
    catch(sqlClientInfoException s)
    {
        String methodCall = "setClientInfo(" + properties + ")";
        reportException(methodCall,null);
        throw s;
    }
}
项目:lams    文件sqlExceptionTypeDelegate.java   
@Override
public JDBCException convert(sqlException sqlException,String message,String sql) {
    if ( sqlClientInfoException.class.isinstance( sqlException )
            || sqlInvalidAuthorizationSpecException.class.isinstance( sqlException )
            || sqlNonTransientConnectionException.class.isinstance( sqlException )
            || sqlTransientConnectionException.class.isinstance( sqlException ) ) {
        return new JDBCConnectionException( message,sqlException,sql );
    }
    else if ( DataTruncation.class.isinstance( sqlException ) ||
            sqlDataException.class.isinstance( sqlException ) ) {
        throw new DataException( message,sql );
    }
    else if ( sqlIntegrityConstraintViolationException.class.isinstance( sqlException ) ) {
        return new ConstraintViolationException(
                message,sql,getConversionContext().getViolatedConstraintNameExtracter().extractConstraintName( sqlException )
        );
    }
    else if ( sqlSyntaxErrorException.class.isinstance( sqlException ) ) {
        return new sqlGrammarException( message,sql );
    }
    else if ( sqlTimeoutException.class.isinstance( sqlException ) ) {
        return new QueryTimeoutException( message,sql );
    }
    else if ( sqlTransactionRollbackException.class.isinstance( sqlException ) ) {
        // Not 100% sure this is completely accurate.  The JavaDocs for sqlTransactionRollbackException state that
        // it indicates sql states starting with '40' and that those usually indicate that:
        //      <quote>
        //          the current statement was automatically rolled back by the database because of deadlock or
        //          other transaction serialization failures.
        //      </quote>
        return new LockAcquisitionException( message,sql );
    }

    return null; // allow other delegates the chance to look
}
项目:jdk8u-jdk    文件sqlClientInfoExceptionTests.java   
/**
 * Create sqlClientInfoException with no-arg constructor
 */
@Test
public void test1() {
    sqlClientInfoException ex = new sqlClientInfoException();
    assertTrue(ex.getMessage() == null
            && ex.getsqlState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0
            && ex.getFailedProperties() == null);
}
项目:iotdb-jdbc    文件TsfileConnection.java   
@Override
   public void setClientInfo(String arg0,String arg1) throws sqlClientInfoException {
throw new sqlClientInfoException("Method not supported",null);
   }
项目:OpenDiabetes    文件JDBCConnection.java   
/**
     * Sets the value of the connection's client info properties.  The
     * <code>Properties</code> object contains the names and values of the client info
     * properties to be set.  The set of client info properties contained in
     * the properties list replaces the current set of client info properties
     * on the connection.  If a property that is currently set on the
     * connection is not present in the properties list,that property is
     * cleared.  Specifying an empty properties list will clear all of the
     * properties on the connection.  See <code>setClientInfo (String,String)</code> for
     * more @R_296_4045@ion.
     * <p>
     * If an error occurs in setting any of the client info properties,a
     * <code>sqlClientInfoException</code> is thrown. The <code>sqlClientInfoException</code>
     * contains @R_296_4045@ion indicating which client info properties were not set.
     * The state of the client @R_296_4045@ion is unkNown because
     * some databases do not allow multiple client info properties to be set
     * atomically.  For those databases,one or more properties may have been
     * set before the error occurred.
     * <p>
     *
     * @param properties                the list of client info properties to set
     * <p>
     * @see java.sql.Connection#setClientInfo(String,String) setClientInfo(String,String)
     * @since JDK 1.6,HsqlDB 2.0
     * <p>
     * @throws sqlClientInfoException if the database server returns an error while
     *                  setting the clientInfo values on the database server or this method
     * is called on a closed connection
     * <p>
     */
//#ifdef JAVA6
    public void setClientInfo(
            Properties properties) throws sqlClientInfoException {

        if (!this.isClosed && (properties == null || properties.isEmpty())) {
            return;
        }

        sqlClientInfoException ex = new sqlClientInfoException();

        if (this.isClosed) {
            ex.initCause(JDBCUtil.connectionClosedException());
        } else {
            ex.initCause(JDBCUtil.notSupported());
        }

        throw ex;
    }
项目:burstcoin    文件FilteredConnection.java   
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
    con.setClientInfo(properties);
}
项目:openjdk-jdk10    文件StubConnection.java   
@Override
public void setClientInfo(String name,String value) throws sqlClientInfoException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:preflex    文件ConnectionWrapper.java   
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
    conn.setClientInfo(properties);
}
项目:BibliotecaPS    文件JDBC4ReplicationMysqLConnection.java   
public void setClientInfo(String name,String value) throws sqlClientInfoException {
    this.getJDBC4Connection().setClientInfo(name,value);
}
项目:pugtsdb    文件PugConnection.java   
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
    connection.setClientInfo(properties);
}
项目:openjdk-jdk10    文件StubConnection.java   
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:mycat-src-1.6.1-RELEASE    文件MongoConnection.java   
@Override
public void setClientInfo(String name,String value)
        throws sqlClientInfoException {

    this._clientInfo.put(name,value);
}
项目:BibliotecaPS    文件JDBC4ReplicationMysqLConnection.java   
public void setClientInfo(Properties properties) throws sqlClientInfoException {
    this.getJDBC4Connection().setClientInfo(properties);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。