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


Java LRUCache类代码示例

本文整理汇总了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());
    }
}
 
开发者ID:Prometheus-ETSIIT,项目名称:locaviewer,代码行数:46,代码来源:ConnectionImpl.java

示例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;
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:8,代码来源:PerConnectionLRUFactory.java

示例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;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:7,代码来源:PerConnectionLRUFactory.java

示例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");
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:50,代码来源:ConnectionImpl.java

示例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;
}
 
开发者ID:rafallis,项目名称:BibliotecaPS,代码行数:7,代码来源:PerConnectionLRUFactory.java

示例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");
    }
}
 
开发者ID:rafallis,项目名称:BibliotecaPS,代码行数:50,代码来源:ConnectionImpl.java

示例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());
	}
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:53,代码来源:ConnectionImpl.java

示例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");
    }
}
 
开发者ID:BasThomas,项目名称:SMPT42,代码行数:50,代码来源:ConnectionImpl.java

示例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());
	}
}
 
开发者ID:OrlandoLee,项目名称:ForYou,代码行数:54,代码来源:ConnectionImpl.java


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