|
|
@ -99,6 +99,8 @@ public class JDBCDefPane extends JPanel { |
|
|
|
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); |
|
|
|
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); |
|
|
|
private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor(); |
|
|
|
private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JDBCDatabaseConnection jdbcDatabase; |
|
|
|
|
|
|
|
|
|
|
|
public JDBCDefPane() { |
|
|
|
public JDBCDefPane() { |
|
|
|
this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); |
|
|
|
this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); |
|
|
|
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
@ -202,6 +204,7 @@ public class JDBCDefPane extends JPanel { |
|
|
|
if (jdbcDatabase == null) { |
|
|
|
if (jdbcDatabase == null) { |
|
|
|
jdbcDatabase = new JDBCDatabaseConnection(); |
|
|
|
jdbcDatabase = new JDBCDatabaseConnection(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.jdbcDatabase = jdbcDatabase; |
|
|
|
if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") |
|
|
|
if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") |
|
|
|
&& jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { |
|
|
|
&& jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { |
|
|
|
this.dbtypeComboBox.setSelectedItem("Access"); |
|
|
|
this.dbtypeComboBox.setSelectedItem("Access"); |
|
|
@ -235,6 +238,7 @@ public class JDBCDefPane extends JPanel { |
|
|
|
if (dbcpAttr == null) { |
|
|
|
if (dbcpAttr == null) { |
|
|
|
dbcpAttr = new DBCPConnectionPoolAttr(); |
|
|
|
dbcpAttr = new DBCPConnectionPoolAttr(); |
|
|
|
jdbcDatabase.setDbcpAttr(dbcpAttr); |
|
|
|
jdbcDatabase.setDbcpAttr(dbcpAttr); |
|
|
|
|
|
|
|
this.jdbcDatabase.setDbcpAttr(dbcpAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize()); |
|
|
|
this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize()); |
|
|
|
this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive()); |
|
|
|
this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive()); |
|
|
@ -251,7 +255,9 @@ public class JDBCDefPane extends JPanel { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JDBCDatabaseConnection update() { |
|
|
|
public JDBCDatabaseConnection update() { |
|
|
|
JDBCDatabaseConnection jdbcDatabase = new JDBCDatabaseConnection(); |
|
|
|
if (jdbcDatabase == null) { |
|
|
|
|
|
|
|
jdbcDatabase = new JDBCDatabaseConnection(); |
|
|
|
|
|
|
|
} |
|
|
|
Object driveItem = this.driverComboBox.getSelectedItem(); |
|
|
|
Object driveItem = this.driverComboBox.getSelectedItem(); |
|
|
|
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); |
|
|
|
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); |
|
|
|
jdbcDatabase.setURL(this.urlTextField.getText().trim()); |
|
|
|
jdbcDatabase.setURL(this.urlTextField.getText().trim()); |
|
|
|