Skip to content

Commit 6c0f6c6

Browse files
authored
Merge pull request #54 from utPLSQL/feature/replace_ucp_with_hikaricp
Feature/replace ucp with hikaricp
2 parents 354f417 + 7735c6d commit 6c0f6c6

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ install:
3434

3535
script:
3636
- mvn package -DskipTests
37-
- mvn package appassembler:assemble
37+
- mvn package jar:jar appassembler:assemble
3838

3939
before_deploy:
4040
- bash .travis/create_release.sh

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ You can also download all development versions from [Bintray](https://bintray.co
2020
* When using reporters for Sonar or Coveralls client needs to be invoked from project's root directory.
2121
* Due to Oracle license we can't ship the necessary oracle libraries directly with utPLSQL-cli. <b>Please download the libraries directly from oracle website and put the jars into the "lib" folder of your utPLSQL-cli installation</b>
2222
* Oracle `ojdbc8` driver
23-
* Oracle `ucp` library
24-
* If you are on a 11g database with non0standard NLS settings, you will also need the `orai18n` library.
23+
* If you are on a 11g database with non standard NLS settings, you will also need the `orai18n` library.
2524
* All of the above can be downloaded from [Oracle download site](http://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html)
2625

2726
## Compatibility
28-
The latest CLI is always compatible with all database frameworks of the same major version.
29-
For example CLI-3.0.4 is compatible with database framework 3.0.0-3.0.4 but not with database framework 2.x.
27+
The latest CLI is always compatible with all database frameworks of the same minor version.
28+
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.
3029

3130
## Usage
3231

pom.xml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
<artifactId>java-api</artifactId>
2323
<version>3.0.4</version>
2424
<scope>compile</scope>
25+
<exclusions>
26+
<exclusion>
27+
<groupId>com.oracle.jdbc</groupId>
28+
<artifactId>ucp</artifactId>
29+
</exclusion>
30+
</exclusions>
2531
</dependency>
2632
<dependency>
2733
<groupId>com.beust</groupId>
@@ -30,10 +36,22 @@
3036
<scope>compile</scope>
3137
</dependency>
3238
<dependency>
33-
<groupId>junit</groupId>
34-
<artifactId>junit</artifactId>
35-
<version>4.12</version>
36-
<scope>test</scope>
39+
<groupId>com.zaxxer</groupId>
40+
<artifactId>HikariCP</artifactId>
41+
<version>2.7.2</version>
42+
<scope>compile</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.slf4j</groupId>
46+
<artifactId>slf4j-nop</artifactId>
47+
<version>1.7.25</version>
48+
<scope>compile</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>junit</groupId>
52+
<artifactId>junit</artifactId>
53+
<version>4.12</version>
54+
<scope>test</scope>
3755
</dependency>
3856
</dependencies>
3957

src/main/java/org/utplsql/cli/ConnectionInfo.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package org.utplsql.cli;
22

33
import com.beust.jcommander.IStringConverter;
4-
import oracle.ucp.jdbc.PoolDataSource;
5-
import oracle.ucp.jdbc.PoolDataSourceFactory;
4+
import com.zaxxer.hikari.HikariDataSource;
65

76
import java.io.File;
87
import java.sql.Connection;
@@ -22,16 +21,13 @@ public class ConnectionInfo {
2221
}
2322
}
2423

25-
private PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource();
24+
private HikariDataSource pds = new HikariDataSource();
2625

2726
public ConnectionInfo(String connectionInfo) {
28-
try {
29-
this.pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
30-
this.pds.setURL("jdbc:oracle:thin:" + connectionInfo);
31-
this.pds.setInitialPoolSize(2);
32-
} catch (SQLException e) {
33-
e.printStackTrace();
34-
}
27+
28+
pds.setJdbcUrl("jdbc:oracle:thin:" + connectionInfo);
29+
pds.setAutoCommit(false);
30+
3531
}
3632

3733
public Connection getConnection() throws SQLException {

0 commit comments

Comments
 (0)