Merge pull request #376 from nitincchauhan/dev

Fix Issue 375 ..restore thing that was not broken
pull/384/head
Brett Wooldridge 10 years ago
commit 9dcb652701

@ -329,6 +329,7 @@ dataSourceClassName=org.postgresql.ds.PGSimpleDataSource
dataSource.user=test dataSource.user=test
dataSource.password=test dataSource.password=test
dataSource.databaseName=mydb dataSource.databaseName=mydb
dataSource.portNumber=5432
dataSource.serverName=localhost dataSource.serverName=localhost
``` ```
or ``java.util.Properties`` based: or ``java.util.Properties`` based:
@ -358,16 +359,18 @@ Here is a list of JDBC *DataSource* classes for popular databases:
|:---------------- |:------------ |:-------------------| |:---------------- |:------------ |:-------------------|
| Apache Derby | Derby | org.apache.derby.jdbc.ClientDataSource | | Apache Derby | Derby | org.apache.derby.jdbc.ClientDataSource |
| Firebird | Jaybird | org.firebirdsql.pool.FBSimpleDataSource | | Firebird | Jaybird | org.firebirdsql.pool.FBSimpleDataSource |
| IBM DB2 | DB2 | com.ibm.db2.jcc.DB2SimpleDataSource |
| H2 | H2 | org.h2.jdbcx.JdbcDataSource | | H2 | H2 | org.h2.jdbcx.JdbcDataSource |
| HSQLDB | HSQLDB | org.hsqldb.jdbc.JDBCDataSource | | HSQLDB | HSQLDB | org.hsqldb.jdbc.JDBCDataSource |
| IBM AS400 | IBM | com.ibm.as400.access.AS400JDBCDriver |
| IBM DB2 | DB2 | com.ibm.db2.jcc.DB2SimpleDataSource |
| MariaDB & MySQL | MariaDB | org.mariadb.jdbc.MySQLDataSource | | MariaDB & MySQL | MariaDB | org.mariadb.jdbc.MySQLDataSource |
| MySQL | Connector/J | com.mysql.jdbc.jdbc2.optional.MysqlDataSource | | MySQL | Connector/J | com.mysql.jdbc.jdbc2.optional.MysqlDataSource |
| MS SQL Server | Microsoft | com.microsoft.sqlserver.jdbc.SQLServerDataSource | | MS SQL Server | Microsoft | com.microsoft.sqlserver.jdbc.SQLServerDataSource |
| Oracle | Oracle | oracle.jdbc.pool.OracleDataSource | | Oracle | Oracle | oracle.jdbc.pool.OracleDataSource |
| PostgreSQL | pgjdbc-ng | com.impossibl.postgres.jdbc.PGDataSource | | PostgreSQL | pgjdbc-ng | com.impossibl.postgres.jdbc.PGDataSource |
| PostgreSQL | PostgreSQL | org.postgresql.ds.PGSimpleDataSource | | PostgreSQL | PostgreSQL | org.postgresql.ds.PGSimpleDataSource |
| SyBase | jConnect | com.sybase.jdbcx.SybDataSource | | SAP MaxDB | SAP | com.sap.dbtech.jdbc.DriverSapDB |
| SyBase | jConnect | com.sybase.jdbc4.jdbc.SybDataSource |
### Play Framework Plugin ### Play Framework Plugin

@ -16,13 +16,12 @@
package com.zaxxer.hikari; package com.zaxxer.hikari;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
@ -849,8 +848,8 @@ public class HikariConfig implements HikariConfigMXBean
protected void loadProperties(String propertyFileName) protected void loadProperties(String propertyFileName)
{ {
final Path propFile = Paths.get(propertyFileName); final File propFile = new File(propertyFileName);
try (final InputStream is = Files.isRegularFile(propFile) ? Files.newInputStream(propFile) : HikariConfig.class.getResourceAsStream(propertyFileName)) { try (final InputStream is = propFile.isFile() ? new FileInputStream(propFile) : this.getClass().getResourceAsStream(propertyFileName)) {
if (is != null) { if (is != null) {
Properties props = new Properties(); Properties props = new Properties();
props.load(is); props.load(is);

Loading…
Cancel
Save