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


Java Messages类代码示例

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


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

示例1: getClientInfoProviderImpl

import com.mysql.jdbc.Messages; //导入依赖的package包/类
public JDBC4ClientInfoProvider getClientInfoProviderImpl() throws SQLException {
    synchronized (getConnectionMutex()) {
        if (this.infoProvider == null) {
            try {
                try {
                    this.infoProvider = (JDBC4ClientInfoProvider) Util.getInstance(getClientInfoProvider(), new Class<?>[0], new Object[0],
                            getExceptionInterceptor());
                } catch (SQLException sqlEx) {
                    if (sqlEx.getCause() instanceof ClassCastException) {
                        // try with package name prepended
                        this.infoProvider = (JDBC4ClientInfoProvider) Util.getInstance("com.mysql.jdbc." + getClientInfoProvider(), new Class<?>[0],
                                new Object[0], getExceptionInterceptor());
                    }
                }
            } catch (ClassCastException cce) {
                throw SQLError.createSQLException(Messages.getString("JDBC4Connection.ClientInfoNotImplemented", new Object[] { getClientInfoProvider() }),
                        SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
            }

            this.infoProvider.initialize(this, this.props);
        }

        return this.infoProvider;
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:26,代码来源:JDBC4Connection.java

示例2: getClientInfoProviderImpl

import com.mysql.jdbc.Messages; //导入依赖的package包/类
public JDBC4ClientInfoProvider getClientInfoProviderImpl() throws SQLException {
    synchronized (getConnectionMutex()) {
        if (this.infoProvider == null) {
            try {
                try {
                    this.infoProvider = (JDBC4ClientInfoProvider) Util.getInstance(getClientInfoProvider(), new Class[0], new Object[0],
                            getExceptionInterceptor());
                } catch (SQLException sqlEx) {
                    if (sqlEx.getCause() instanceof ClassCastException) {
                        // try with package name prepended
                        this.infoProvider = (JDBC4ClientInfoProvider) Util.getInstance("com.mysql.jdbc." + getClientInfoProvider(), new Class[0],
                                new Object[0], getExceptionInterceptor());
                    }
                }
            } catch (ClassCastException cce) {
                throw SQLError.createSQLException(Messages.getString("JDBC4Connection.ClientInfoNotImplemented", new Object[] { getClientInfoProvider() }),
                        SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
            }

            this.infoProvider.initialize(this, this.props);
        }

        return this.infoProvider;
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:JDBC4Connection.java

示例3: getClientInfoProviderImpl

import com.mysql.jdbc.Messages; //导入依赖的package包/类
protected JDBC4ClientInfoProvider getClientInfoProviderImpl() throws SQLException {
    synchronized (getConnectionMutex()) {
        if (this.infoProvider == null) {
            try {
                try {
                    this.infoProvider = (JDBC4ClientInfoProvider) Util.getInstance(getClientInfoProvider(), new Class[0], new Object[0],
                            getExceptionInterceptor());
                } catch (SQLException sqlEx) {
                    if (sqlEx.getCause() instanceof ClassCastException) {
                        // try with package name prepended
                        this.infoProvider = (JDBC4ClientInfoProvider) Util.getInstance("com.mysql.jdbc." + getClientInfoProvider(), new Class[0],
                                new Object[0], getExceptionInterceptor());
                    }
                }
            } catch (ClassCastException cce) {
                throw SQLError.createSQLException(Messages.getString("JDBC4Connection.ClientInfoNotImplemented", new Object[] { getClientInfoProvider() }),
                        SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
            }

            this.infoProvider.initialize(this, this.props);
        }

        return this.infoProvider;
    }
}
 
开发者ID:mniepert,项目名称:TPKB,代码行数:26,代码来源:JDBC4Connection.java

示例4: containsMessage

import com.mysql.jdbc.Messages; //导入依赖的package包/类
public static boolean containsMessage(String msg, String key) {
    String[] expectedFragments = Messages.getString(key).split("\\{\\d\\}");
    for (int i = 0; i < expectedFragments.length; i++) {
        if (msg.indexOf(expectedFragments[i]) < 0) {
            return false;
        }
    }
    return true;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:10,代码来源:ConnectionRegressionTest.java

示例5: isStatementClosedForTestBug69746

import com.mysql.jdbc.Messages; //导入依赖的package包/类
private boolean isStatementClosedForTestBug69746(Statement statement) {
    try {
        statement.getResultSet();
    } catch (SQLException ex) {
        return ex.getMessage().equalsIgnoreCase(Messages.getString("Statement.49"));
    }
    return false;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:9,代码来源:ConnectionRegressionTest.java

示例6: isResultSetClosedForTestBug69746

import com.mysql.jdbc.Messages; //导入依赖的package包/类
private boolean isResultSetClosedForTestBug69746(ResultSet resultSet) {
    try {
        resultSet.first();
    } catch (SQLException ex) {
        return ex.getMessage().equalsIgnoreCase(Messages.getString("ResultSet.Operation_not_allowed_after_ResultSet_closed_144"));
    }
    return false;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:9,代码来源:ConnectionRegressionTest.java

示例7: encryptPassword

import com.mysql.jdbc.Messages; //导入依赖的package包/类
private static byte[] encryptPassword(String password, String seed, Connection connection, String key) throws SQLException {
    byte[] input = null;
    try {
        input = password != null ? StringUtils.getBytesNullTerminated(password, connection.getPasswordCharacterEncoding()) : new byte[] { 0 };
    } catch (UnsupportedEncodingException e) {
        throw SQLError.createSQLException(Messages.getString("Sha256PasswordPlugin.3", new Object[] { connection.getPasswordCharacterEncoding() }),
                SQLError.SQL_STATE_GENERAL_ERROR, null);
    }
    byte[] mysqlScrambleBuff = new byte[input.length];
    Security.xorString(input, mysqlScrambleBuff, seed.getBytes(), input.length);
    return ExportControlled.encryptWithRSAPublicKey(mysqlScrambleBuff,
            ExportControlled.decodeRSAPublicKey(key, ((MySQLConnection) connection).getExceptionInterceptor()),
            ((MySQLConnection) connection).getExceptionInterceptor());
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:15,代码来源:Sha256PasswordPlugin.java

示例8: mapXAExceptionFromSQLException

import com.mysql.jdbc.Messages; //导入依赖的package包/类
protected static XAException mapXAExceptionFromSQLException(SQLException sqlEx) {
    Integer xaCode = MYSQL_ERROR_CODES_TO_XA_ERROR_CODES.get(sqlEx.getErrorCode());

    if (xaCode != null) {
        return (XAException) new MysqlXAException(xaCode.intValue(), sqlEx.getMessage(), null).initCause(sqlEx);
    }

    return (XAException) new MysqlXAException(XAException.XAER_RMFAIL, Messages.getString("MysqlXAConnection.003"), null).initCause(sqlEx);
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:10,代码来源:MysqlXAConnection.java

示例9: checkSqlType

import com.mysql.jdbc.Messages; //导入依赖的package包/类
static int checkSqlType(int sqlType, ExceptionInterceptor exceptionInterceptor) throws SQLException {
    if (JDBC42Helper.isSqlTypeSupported(sqlType)) {
        return sqlType;
    }
    throw SQLError.createSQLFeatureNotSupportedException(Messages.getString("UnsupportedSQLType.0") + JDBCType.valueOf(sqlType),
            SQLError.SQL_STATE_DRIVER_NOT_CAPABLE, exceptionInterceptor);
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:8,代码来源:JDBC42Helper.java

示例10: mapXAExceptionFromSQLException

import com.mysql.jdbc.Messages; //导入依赖的package包/类
protected static XAException mapXAExceptionFromSQLException(SQLException sqlEx) {
    Integer xaCode = MYSQL_ERROR_CODES_TO_XA_ERROR_CODES.get(Integer.valueOf(sqlEx.getErrorCode()));

    if (xaCode != null) {
        return (XAException) new MysqlXAException(xaCode.intValue(), sqlEx.getMessage(), null).initCause(sqlEx);
    }

    return (XAException) new MysqlXAException(XAException.XAER_RMFAIL, Messages.getString("MysqlXAConnection.003"), null).initCause(sqlEx);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:MysqlXAConnection.java


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