本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}