Skip to content

Commit

Permalink
Merge pull request #10 from swaldman/master
Browse files Browse the repository at this point in the history
Added a constructor for HikariConfig that accepts a Properties object. M...
  • Loading branch information
brettwooldridge committed Dec 14, 2013
2 parents 78ffed0 + 6c84ea8 commit 506b1df
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions core/src/main/java/com/zaxxer/hikari/HikariConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ public HikariConfig()
poolName = "HikariPool-" + poolNumber++;
}

/**
* Construct a HikariConfig from the specified properties object.
*
* @param properties the name of the property file
*/
public HikariConfig(Properties properties)
{
this();
PropertyBeanSetter.setTargetFromProperties(this, properties);
}


/**
* Construct a HikariConfig from the specified property file name.
*
Expand All @@ -96,9 +108,8 @@ public HikariConfig(String propertyFileName)
throw new IllegalArgumentException("Property file " + propertyFileName + " was not found.");
}

try
try ( FileInputStream fis = new FileInputStream(propFile) )
{
FileInputStream fis = new FileInputStream(propFile);
Properties props = new Properties();
props.load(fis);
PropertyBeanSetter.setTargetFromProperties(this, props);
Expand Down

0 comments on commit 506b1df

Please sign in to comment.