From e789d03571bad8e976877ee9649ec3c9f790d016 Mon Sep 17 00:00:00 2001 From: Nitin Date: Sat, 8 Aug 2015 21:07:06 +0530 Subject: [PATCH] Fix Issue 375 ..restore thing that was not broken Fixed Readme ...added missing changes from master --- README.md | 7 +++++-- src/main/java/com/zaxxer/hikari/HikariConfig.java | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e3f2b684..526d68fc 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,7 @@ dataSourceClassName=org.postgresql.ds.PGSimpleDataSource dataSource.user=test dataSource.password=test dataSource.databaseName=mydb +dataSource.portNumber=5432 dataSource.serverName=localhost ``` 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 | | Firebird | Jaybird | org.firebirdsql.pool.FBSimpleDataSource | -| IBM DB2 | DB2 | com.ibm.db2.jcc.DB2SimpleDataSource | | H2 | H2 | org.h2.jdbcx.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 | | MySQL | Connector/J | com.mysql.jdbc.jdbc2.optional.MysqlDataSource | | MS SQL Server | Microsoft | com.microsoft.sqlserver.jdbc.SQLServerDataSource | | Oracle | Oracle | oracle.jdbc.pool.OracleDataSource | | PostgreSQL | pgjdbc-ng | com.impossibl.postgres.jdbc.PGDataSource | | 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 diff --git a/src/main/java/com/zaxxer/hikari/HikariConfig.java b/src/main/java/com/zaxxer/hikari/HikariConfig.java index 632223c8..945bba11 100644 --- a/src/main/java/com/zaxxer/hikari/HikariConfig.java +++ b/src/main/java/com/zaxxer/hikari/HikariConfig.java @@ -16,13 +16,12 @@ package com.zaxxer.hikari; +import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; 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.Set; import java.util.TreeSet; @@ -849,8 +848,8 @@ public class HikariConfig implements HikariConfigMXBean protected void loadProperties(String propertyFileName) { - final Path propFile = Paths.get(propertyFileName); - try (final InputStream is = Files.isRegularFile(propFile) ? Files.newInputStream(propFile) : HikariConfig.class.getResourceAsStream(propertyFileName)) { + final File propFile = new File(propertyFileName); + try (final InputStream is = propFile.isFile() ? new FileInputStream(propFile) : this.getClass().getResourceAsStream(propertyFileName)) { if (is != null) { Properties props = new Properties(); props.load(is);