本文整理汇总了Java中com.mysql.jdbc.util.LRUCache类的典型用法代码示例。如果您正苦于以下问题:Java LRUCache类的具体用法?Java LRUCache怎么用?Java LRUCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LRUCache类属于com.mysql.jdbc.util包,在下文中一共展示了LRUCache类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeDriverProperties
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
/**
* Initializes driver properties that come from URL or properties passed to
* the driver manager.
*
* @param info
* @throws SQLException
*/
private void initializeDriverProperties(Properties info) throws SQLException {
initializeProperties(info);
String exceptionInterceptorClasses = getExceptionInterceptors();
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
}
this.usePlatformCharsetConverters = getUseJvmCharsetConverters();
this.log = LogFactory.getLogger(getLogger(), LOGGER_INSTANCE_NAME, getExceptionInterceptor());
if (getProfileSql() || getUseUsageAdvisor()) {
this.eventSink = ProfilerEventHandlerFactory.getInstance(getLoadBalanceSafeProxy());
}
if (getCachePreparedStatements()) {
createPreparedStatementCaches();
}
if (getNoDatetimeStringSync() && getUseTimezone()) {
throw SQLError.createSQLException("Can't enable noDatetimeStringSync and useTimezone configuration properties at the same time",
SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE, getExceptionInterceptor());
}
if (getCacheCallableStatements()) {
this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
}
if (getAllowMultiQueries()) {
setCacheResultSetMetadata(false); // we don't handle this yet
}
if (getCacheResultSetMetadata()) {
this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
}
}
示例2: PerConnectionLRU
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
protected PerConnectionLRU(Connection forConnection, int cacheMaxSize,
int maxKeySize) {
final int cacheSize = cacheMaxSize;
cacheSqlLimit = maxKeySize;
cache = new LRUCache(cacheSize);
conn = forConnection;
}
示例3: PerConnectionLRU
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
protected PerConnectionLRU(Connection forConnection, int cacheMaxSize, int maxKeySize) {
final int cacheSize = cacheMaxSize;
this.cacheSqlLimit = maxKeySize;
this.cache = new LRUCache(cacheSize);
this.conn = forConnection;
}
示例4: initializeDriverProperties
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
/**
* Initializes driver properties that come from URL or properties passed to
* the driver manager.
*
* @param info
* @throws SQLException
*/
private void initializeDriverProperties(Properties info) throws SQLException {
initializeProperties(info);
String exceptionInterceptorClasses = getExceptionInterceptors();
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
}
this.usePlatformCharsetConverters = getUseJvmCharsetConverters();
this.log = LogFactory.getLogger(getLogger(), LOGGER_INSTANCE_NAME, getExceptionInterceptor());
if (getProfileSql() || getUseUsageAdvisor()) {
this.eventSink = ProfilerEventHandlerFactory.getInstance(getMultiHostSafeProxy());
}
if (getCachePreparedStatements()) {
createPreparedStatementCaches();
}
if (getNoDatetimeStringSync() && getUseTimezone()) {
throw SQLError.createSQLException("Can't enable noDatetimeStringSync and useTimezone configuration properties at the same time",
SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE, getExceptionInterceptor());
}
if (getCacheCallableStatements()) {
this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
}
if (getAllowMultiQueries()) {
setCacheResultSetMetadata(false); // we don't handle this yet
}
if (getCacheResultSetMetadata()) {
this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
}
if (getSocksProxyHost() != null) {
setSocketFactoryClassName("com.mysql.jdbc.SocksProxySocketFactory");
}
}
示例5: PerConnectionLRU
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
protected PerConnectionLRU(Connection forConnection, int cacheMaxSize, int maxKeySize) {
final int cacheSize = cacheMaxSize;
this.cacheSqlLimit = maxKeySize;
this.cache = new LRUCache<String, ParseInfo>(cacheSize);
this.conn = forConnection;
}
示例6: initializeDriverProperties
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
/**
* Initializes driver properties that come from URL or properties passed to
* the driver manager.
*
* @param info
* @throws SQLException
*/
private void initializeDriverProperties(Properties info) throws SQLException {
initializeProperties(info);
String exceptionInterceptorClasses = getExceptionInterceptors();
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
}
this.usePlatformCharsetConverters = getUseJvmCharsetConverters();
this.log = LogFactory.getLogger(getLogger(), LOGGER_INSTANCE_NAME, getExceptionInterceptor());
if (getProfileSql() || getUseUsageAdvisor()) {
this.eventSink = ProfilerEventHandlerFactory.getInstance(getMultiHostSafeProxy());
}
if (getCachePreparedStatements()) {
createPreparedStatementCaches();
}
if (getNoDatetimeStringSync() && getUseTimezone()) {
throw SQLError.createSQLException("Can't enable noDatetimeStringSync and useTimezone configuration properties at the same time",
SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE, getExceptionInterceptor());
}
if (getCacheCallableStatements()) {
this.parsedCallableStatementCache = new LRUCache<CompoundCacheKey, CallableStatement.CallableStatementParamInfo>(getCallableStatementCacheSize());
}
if (getAllowMultiQueries()) {
setCacheResultSetMetadata(false); // we don't handle this yet
}
if (getCacheResultSetMetadata()) {
this.resultSetMetadataCache = new LRUCache<String, CachedResultSetMetaData>(getMetadataCacheSize());
}
if (getSocksProxyHost() != null) {
setSocketFactoryClassName("com.mysql.jdbc.SocksProxySocketFactory");
}
}
示例7: initializeDriverProperties
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
/**
* Initializes driver properties that come from URL or properties passed to
* the driver manager.
*
* @param info
* DOCUMENT ME!
* @throws SQLException
* DOCUMENT ME!
*/
private void initializeDriverProperties(Properties info)
throws SQLException {
initializeProperties(info);
String exceptionInterceptorClasses = getExceptionInterceptors();
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
}
this.usePlatformCharsetConverters = getUseJvmCharsetConverters();
this.log = LogFactory.getLogger(getLogger(), LOGGER_INSTANCE_NAME, getExceptionInterceptor());
if (getProfileSql() || getUseUsageAdvisor()) {
this.eventSink = ProfilerEventHandlerFactory.getInstance(getLoadBalanceSafeProxy());
}
if (getCachePreparedStatements()) {
createPreparedStatementCaches();
}
if (getNoDatetimeStringSync() && getUseTimezone()) {
throw SQLError.createSQLException(
"Can't enable noDatetimeStringSync and useTimezone configuration "
+ "properties at the same time",
SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE, getExceptionInterceptor());
}
if (getCacheCallableStatements()) {
this.parsedCallableStatementCache = new LRUCache(
getCallableStatementCacheSize());
}
if (getAllowMultiQueries()) {
setCacheResultSetMetadata(false); // we don't handle this yet
}
if (getCacheResultSetMetadata()) {
this.resultSetMetadataCache = new LRUCache(
getMetadataCacheSize());
}
}
示例8: initializeDriverProperties
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
/**
* Initializes driver properties that come from URL or properties passed to
* the driver manager.
*
* @param info
* @throws SQLException
*/
private void initializeDriverProperties(Properties info) throws SQLException {
initializeProperties(info);
String exceptionInterceptorClasses = getExceptionInterceptors();
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
}
this.usePlatformCharsetConverters = getUseJvmCharsetConverters();
this.log = LogFactory.getLogger(getLogger(), LOGGER_INSTANCE_NAME, getExceptionInterceptor());
if (getProfileSql() || getUseUsageAdvisor()) {
this.eventSink = ProfilerEventHandlerFactory.getInstance(getLoadBalanceSafeProxy());
}
if (getCachePreparedStatements()) {
createPreparedStatementCaches();
}
if (getNoDatetimeStringSync() && getUseTimezone()) {
throw SQLError.createSQLException("Can't enable noDatetimeStringSync and useTimezone configuration properties at the same time",
SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE, getExceptionInterceptor());
}
if (getCacheCallableStatements()) {
this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
}
if (getAllowMultiQueries()) {
setCacheResultSetMetadata(false); // we don't handle this yet
}
if (getCacheResultSetMetadata()) {
this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
}
if (getSocksProxyHost() != null) {
setSocketFactoryClassName("com.mysql.jdbc.SocksProxySocketFactory");
}
}
示例9: initializeDriverProperties
import com.mysql.jdbc.util.LRUCache; //导入依赖的package包/类
/**
* Initializes driver properties that come from URL or properties passed to
* the driver manager.
*
* @param info
* DOCUMENT ME!
* @throws SQLException
* DOCUMENT ME!
*/
private void initializeDriverProperties(Properties info)
throws SQLException {
initializeProperties(info);
String exceptionInterceptorClasses = getExceptionInterceptors();
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses);
this.exceptionInterceptor.init(this, info);
}
this.usePlatformCharsetConverters = getUseJvmCharsetConverters();
this.log = LogFactory.getLogger(getLogger(), LOGGER_INSTANCE_NAME, getExceptionInterceptor());
if (getProfileSql() || getUseUsageAdvisor()) {
this.eventSink = ProfilerEventHandlerFactory.getInstance(getLoadBalanceSafeProxy());
}
if (getCachePreparedStatements()) {
createPreparedStatementCaches();
}
if (getNoDatetimeStringSync() && getUseTimezone()) {
throw SQLError.createSQLException(
"Can't enable noDatetimeStringSync and useTimezone configuration "
+ "properties at the same time",
SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE, getExceptionInterceptor());
}
if (getCacheCallableStatements()) {
this.parsedCallableStatementCache = new LRUCache(
getCallableStatementCacheSize());
}
if (getAllowMultiQueries()) {
setCacheResultSetMetadata(false); // we don't handle this yet
}
if (getCacheResultSetMetadata()) {
this.resultSetMetadataCache = new LRUCache(
getMetadataCacheSize());
}
}