Package com.mysql.jdbc.util

Examples of com.mysql.jdbc.util.LRUCache


        cachedMetaData.fullColumnNameToIndex = resultSet.fullColumnNameToIndex;

        cachedMetaData.metadata = resultSet.getMetaData();

        if (this.resultSetMetadataCache == null) {
          this.resultSetMetadataCache = new LRUCache(this.connection
              .getMetadataCacheSize());
        }

        this.resultSetMetadataCache.put(sql, cachedMetaData);
      } else {
View Full Code Here


   
    protected PerConnectionLRU(Connection forConnection, int cacheMaxSize,
        int maxKeySize) {
      final int cacheSize = cacheMaxSize;
      cacheSqlLimit = maxKeySize;
      cache = new LRUCache(cacheSize);
      conn = forConnection;
    }
View Full Code Here

       
        throw sqlEx;
      }
 
      if (getUseServerPreparedStmts()) {
        this.serverSideStatementCheckCache = new LRUCache(cacheSize);
       
        this.serverSideStatementCache = new LRUCache(cacheSize) {
 
          private static final long serialVersionUID = 7692318650375988114L;
 
          protected boolean removeEldestEntry(java.util.Map.Entry<Object, Object> eldest) {
            if (this.maxElements <= 1) {
View Full Code Here

              + "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());
    }
  }
View Full Code Here

  private void createPreparedStatementCaches() {
    int cacheSize = getPreparedStatementCacheSize();
   
    this.cachedPreparedStatementParams = new HashMap(cacheSize);
   
    this.serverSideStatementCheckCache = new LRUCache(cacheSize);
   
    this.serverSideStatementCache = new LRUCache(cacheSize) {
      protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
        if (this.maxElements <= 1) {
          return false;
        }
       
View Full Code Here

      if (!getCacheCallableStatements()) {

        cStmt = parseCallableStatement(sql);
      } else {
        if (this.parsedCallableStatementCache == null) {
          this.parsedCallableStatementCache = new LRUCache(
              getCallableStatementCacheSize());
        }

        CompoundCacheKey key = new CompoundCacheKey(getCatalog(), sql);
View Full Code Here

    int cacheSize = getPreparedStatementCacheSize();
   
    this.cachedPreparedStatementParams = new HashMap(cacheSize);
   
    if (getUseServerPreparedStmts()) {
      this.serverSideStatementCheckCache = new LRUCache(cacheSize);
     
      this.serverSideStatementCache = new LRUCache(cacheSize) {
        protected boolean removeEldestEntry(java.util.Map.Entry eldest) {
          if (this.maxElements <= 1) {
            return false;
          }
         
View Full Code Here

              + "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());
    }
  }
View Full Code Here

       
        throw sqlEx;
      }
 
      if (getUseServerPreparedStmts()) {
        this.serverSideStatementCheckCache = new LRUCache(cacheSize);
       
        this.serverSideStatementCache = new LRUCache(cacheSize) {
 
          private static final long serialVersionUID = 7692318650375988114L;
 
          protected boolean removeEldestEntry(java.util.Map.Entry<Object, Object> eldest) {
            if (this.maxElements <= 1) {
View Full Code Here

              + "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());
    }
  }
View Full Code Here

TOP

Related Classes of com.mysql.jdbc.util.LRUCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.