コード例 #1
0
 static {
   String excludeStr =
       C3P0Config.getMultiPropertiesConfig().getProperty(EXCLUDE_IDENTITY_TOKEN_KEY);
   if (excludeStr == null) EXCLUDE_IDENTITY_TOKEN = false;
   else EXCLUDE_IDENTITY_TOKEN = Boolean.parseBoolean(excludeStr.trim().toLowerCase());
   if (EXCLUDE_IDENTITY_TOKEN)
     logger.info(
         EXCLUDE_IDENTITY_TOKEN_KEY
             + " set to true; please ensure unique dataSourceName values are set for all PooledDataSources.");
 }
コード例 #2
0
 protected void initializeNamedConfig(String configName) {
   try {
     if (configName != null) {
       C3P0Config.bindNamedConfigToBean(this, configName);
       if (this.getDataSourceName()
           .equals(this.getIdentityToken())) // dataSourceName has not been specified in config
       this.setDataSourceName(configName);
     }
   } catch (Exception e) {
     if (logger.isLoggable(MLevel.WARNING))
       logger.log(
           MLevel.WARNING,
           "Error binding PoolBackedDataSource to named-config '"
               + configName
               + "'. Some default-config values may be used.",
           e);
   }
 }
コード例 #3
0
 private static String getRegistryName() {
   String name = C3P0Config.getMultiPropertiesConfig().getProperty(C3P0_REGISTRY_NAME_KEY);
   if (name == null) name = C3P0_REGISTRY_NAME_PFX; // a name property is optional
   else name = C3P0_REGISTRY_NAME_PFX + ",name=" + name;
   return name;
 }