File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/main/java/org/utplsql/maven/plugin Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 22
33import java .io .File ;
44import java .sql .Connection ;
5- import java .sql .DriverManager ;
65import java .sql .SQLException ;
76import java .util .ArrayList ;
87import java .util .List ;
9-
8+ import oracle . jdbc . pool . OracleDataSource ;
109import org .apache .commons .lang3 .StringUtils ;
1110import org .apache .maven .model .Resource ;
1211import org .apache .maven .plugin .AbstractMojo ;
@@ -135,8 +134,11 @@ public void execute() throws MojoExecutionException {
135134 try {
136135 FileMapperOptions sourceMappingOptions = buildSourcesOptions ();
137136 FileMapperOptions testMappingOptions = buildTestsOptions ();
138-
139- connection = DriverManager .getConnection (url , user , password );
137+ OracleDataSource ds = new OracleDataSource ();
138+ ds .setURL (url );
139+ ds .setUser (user );
140+ ds .setPassword (password );
141+ connection = ds .getConnection ();
140142
141143 Version utlVersion = DBHelper .getDatabaseFrameworkVersion (connection );
142144 getLog ().info ("utPLSQL Version = " + utlVersion );
@@ -173,6 +175,7 @@ public void execute() throws MojoExecutionException {
173175 try {
174176 if (null != connection ) {
175177 reporterWriter .writeReporters (connection );
178+ connection .close ();
176179 }
177180 } catch (Exception e ) {
178181 getLog ().error (e .getMessage (), e );
You can’t perform that action at this time.
0 commit comments