File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/main/java/org/utplsql/cli Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11package org .utplsql .cli ;
22
33import com .beust .jcommander .IStringConverter ;
4+ import oracle .ucp .jdbc .PoolDataSource ;
5+ import oracle .ucp .jdbc .PoolDataSourceFactory ;
46
57import java .io .File ;
68import java .sql .Connection ;
7- import java .sql .DriverManager ;
89import java .sql .SQLException ;
910
1011public class ConnectionInfo {
@@ -17,14 +18,20 @@ public class ConnectionInfo {
1718 }
1819 }
1920
20- private String connectionInfo ;
21+ private PoolDataSource pds = PoolDataSourceFactory . getPoolDataSource () ;
2122
2223 public ConnectionInfo (String connectionInfo ) {
23- this .connectionInfo = connectionInfo ;
24+ try {
25+ this .pds .setConnectionFactoryClassName ("oracle.jdbc.pool.OracleDataSource" );
26+ this .pds .setURL ("jdbc:oracle:thin:" + connectionInfo );
27+ this .pds .setInitialPoolSize (2 );
28+ } catch (SQLException e ) {
29+ e .printStackTrace ();
30+ }
2431 }
2532
2633 public Connection getConnection () throws SQLException {
27- return DriverManager .getConnection ("jdbc:oracle:thin:" + this . connectionInfo );
34+ return pds .getConnection ();
2835 }
2936
3037 public static class ConnectionStringConverter implements IStringConverter <ConnectionInfo > {
You can’t perform that action at this time.
0 commit comments