Package com.mysql.jdbc.util

Examples of com.mysql.jdbc.util.LRUCache


       
        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

    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

    DEBUG.P("cacheSize=" + cacheSize);
    DEBUG.P("getUseServerPreparedStmts()=" + getUseServerPreparedStmts());

    //当useServerPrepStmts=true 或 useCursorFetch=true时
    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

    //cacheCallableStmts属性默认是false
    DEBUG.P("getCacheCallableStatements()=" + getCacheCallableStatements());
    if (getCacheCallableStatements()) {
      //callableStmtCacheSize属性默认是100
      this.parsedCallableStatementCache = new LRUCache(getCallableStatementCacheSize());
    }

    //allowMultiQueries属性默认是false
    if (getAllowMultiQueries()) {
      setCacheResultSetMetadata(false); // we don't handle this yet
    }

    DEBUG.P("getAllowMultiQueries()=" + getAllowMultiQueries());
    DEBUG.P("getCacheResultSetMetadata()=" + getCacheResultSetMetadata());

    //当cacheResultSetMetadata=true 且 allowMultiQueries=false
    if (getCacheResultSetMetadata()) {
      //metadataCacheSize属性默认是50,
      //相当于可以缓存50条不同查询sql对应的ResultSetMetadata
      this.resultSetMetadataCache = new LRUCache(getMetadataCacheSize());
    }

    } finally {//我加上的
    DEBUG.P(0, this, "initializeDriverProperties(1)");
    }
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

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.