From d0fa80ced9b0db520c099023b94c459465f5093a Mon Sep 17 00:00:00 2001 From: pesse Date: Tue, 21 Nov 2017 17:11:06 +0100 Subject: [PATCH 1/3] Replace Oracle Connection Pool with HikariCP --- pom.xml | 26 ++++++++++++++++--- .../java/org/utplsql/cli/ConnectionInfo.java | 16 +++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index eef3a59..2f5dd67 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,12 @@ java-api 3.0.4 compile + + + com.oracle.jdbc + ucp + + com.beust @@ -30,10 +36,22 @@ compile - junit - junit - 4.12 - test + com.zaxxer + HikariCP + 2.7.2 + compile + + + org.slf4j + slf4j-nop + 1.7.25 + compile + + + junit + junit + 4.12 + test diff --git a/src/main/java/org/utplsql/cli/ConnectionInfo.java b/src/main/java/org/utplsql/cli/ConnectionInfo.java index 4f76f81..d96a67f 100644 --- a/src/main/java/org/utplsql/cli/ConnectionInfo.java +++ b/src/main/java/org/utplsql/cli/ConnectionInfo.java @@ -1,8 +1,7 @@ package org.utplsql.cli; import com.beust.jcommander.IStringConverter; -import oracle.ucp.jdbc.PoolDataSource; -import oracle.ucp.jdbc.PoolDataSourceFactory; +import com.zaxxer.hikari.HikariDataSource; import java.io.File; import java.sql.Connection; @@ -22,16 +21,13 @@ public class ConnectionInfo { } } - private PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource(); + private HikariDataSource pds = new HikariDataSource(); public ConnectionInfo(String connectionInfo) { - try { - this.pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource"); - this.pds.setURL("jdbc:oracle:thin:" + connectionInfo); - this.pds.setInitialPoolSize(2); - } catch (SQLException e) { - e.printStackTrace(); - } + + pds.setJdbcUrl("jdbc:oracle:thin:" + connectionInfo); + pds.setAutoCommit(false); + } public Connection getConnection() throws SQLException { From 356e95b6d9931216d41bdc1f0f10d79d98ca8f9d Mon Sep 17 00:00:00 2001 From: pesse Date: Tue, 21 Nov 2017 17:16:37 +0100 Subject: [PATCH 2/3] Fix problem appassembler not packing cli-jar into assembly --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c1f85c2..5ef4630 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ install: script: - mvn package -DskipTests - - mvn package appassembler:assemble + - mvn package jar:jar appassembler:assemble before_deploy: - bash .travis/create_release.sh From 7735c6db93fc3630988daeb449743bd234e48695 Mon Sep 17 00:00:00 2001 From: pesse Date: Tue, 21 Nov 2017 17:20:09 +0100 Subject: [PATCH 3/3] Updated docs --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 945d052..fd88eed 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,12 @@ You can also download all development versions from [Bintray](https://bintray.co * When using reporters for Sonar or Coveralls client needs to be invoked from project's root directory. * Due to Oracle license we can't ship the necessary oracle libraries directly with utPLSQL-cli. Please download the libraries directly from oracle website and put the jars into the "lib" folder of your utPLSQL-cli installation * Oracle `ojdbc8` driver - * Oracle `ucp` library - * If you are on a 11g database with non0standard NLS settings, you will also need the `orai18n` library. + * If you are on a 11g database with non standard NLS settings, you will also need the `orai18n` library. * All of the above can be downloaded from [Oracle download site](http://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html) ## Compatibility -The latest CLI is always compatible with all database frameworks of the same major version. -For example CLI-3.0.4 is compatible with database framework 3.0.0-3.0.4 but not with database framework 2.x. +The latest CLI is always compatible with all database frameworks of the same minor version. +For example CLI-3.0.4 is compatible with database framework 3.0.0-3.0.4 but not with database framework 2.x and 3.1.x. ## Usage