From: Clebert S. <csu...@jb...> - 2005-06-06 21:42:13
|
User: csuconic Date: 05/06/06 17:41:43 Modified: src/main/org/jboss/jrunit/controller/persistence DatabaseBenchmarkReceiver.java Log: Refactoring for database persistence (creating BenchmarkExecution) Revision Changes Path 1.3 +8 -14 jrunit/src/main/org/jboss/jrunit/controller/persistence/DatabaseBenchmarkReceiver.java (In the diff below, changes in quantity of whitespace are not shown.) Index: DatabaseBenchmarkReceiver.java =================================================================== RCS file: /cvsroot/jboss/jrunit/src/main/org/jboss/jrunit/controller/persistence/DatabaseBenchmarkReceiver.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- DatabaseBenchmarkReceiver.java 2 Jun 2005 04:35:48 -0000 1.2 +++ DatabaseBenchmarkReceiver.java 6 Jun 2005 21:41:43 -0000 1.3 @@ -12,6 +12,7 @@ import org.jboss.jrunit.communication.message.AntQuitMessage; import java.sql.Connection; +import java.sql.DriverManager; /** * @author cle...@jb... @@ -19,28 +20,20 @@ public class DatabaseBenchmarkReceiver extends AbstractBenchmarkReceiver { String jdbcClass; + String jdbcConnection; String jdbcUserName; String jdbcPassword; - public DatabaseBenchmarkReceiver(String jdbcClass) throws Exception - { - this(null, jdbcClass); - } - - public DatabaseBenchmarkReceiver(String jdbcClass, String jdbcUserName, String jdbcPassword) throws Exception - { - this(null, jdbcClass, jdbcUserName, jdbcPassword); - } - - public DatabaseBenchmarkReceiver(BenchmarkQuitListener benchmarkQuitListener, String jdbcClass) throws Exception + public DatabaseBenchmarkReceiver(BenchmarkQuitListener benchmarkQuitListener, String jdbcConnection, String jdbcClass) throws Exception { super(benchmarkQuitListener); this.jdbcClass = jdbcClass; + this.jdbcConnection = jdbcConnection; } - public DatabaseBenchmarkReceiver(BenchmarkQuitListener benchmarkQuitListener, String jdbcClass, String jdbcUserName, String jdbcPassword) throws Exception + public DatabaseBenchmarkReceiver(BenchmarkQuitListener benchmarkQuitListener, String jdbcConnection, String jdbcClass, String jdbcUserName, String jdbcPassword) throws Exception { - this(benchmarkQuitListener, jdbcClass); + this(benchmarkQuitListener, jdbcClass, jdbcConnection); this.jdbcUserName = jdbcUserName; this.jdbcPassword = jdbcPassword; } @@ -54,11 +47,12 @@ { Class.forName(jdbcClass); } + Connection conn = null; if (jdbcUserName != null) { - + conn = DriverManager.getConnection(jdbcConnection,jdbcUserName,jdbcPassword); } } catch (Exception e) { |