if (extractTable) {
SQLParser parser = new SQLParser(sql, paramList, connection);
return parser.parse(extractTable);
}
SimpleLRUCache cache = getCache(connection);
SQLCacheKey cacheKey = new SQLCacheKey(sql, connection);
// By not synchronizing on the cache, we're admitting that the possibility of multiple
// parses of the same statement can occur. However, it is 1) unlikely under normal
// usage, and 2) harmless to the cache. By avoiding a synchronization block around
// the get()-parse()-put(), we reduce the contention greatly in the nominal case.
CachedSQLQuery cachedQuery = (CachedSQLQuery) cache.get(cacheKey);
if (cachedQuery == null) {
// Parse and cache SQL
SQLParser parser = new SQLParser(sql, paramList, connection);
cachedQuery = new CachedSQLQuery(parser.parse(extractTable),
paramList);
cache.put(cacheKey, cachedQuery);
} else {
// Create full ParamInfo objects out of cached object
final int length = (cachedQuery.paramNames == null)
? 0 : cachedQuery.paramNames.length;
for (int i = 0; i < length; i++) {