private boolean promptForPassword = false;
private boolean autoCommit = true;
private String autoCommitPreference = IQuantumConstants.autoCommitTrue;
+ private Database database;
public Bookmark() {
this(MultiSQLServer.getInstance());
this.connection = connection;
}
- public void disconnect() throws ConnectionException {
+ public void disconnect() throws SQLException {
boolean isConnected = isConnected();
try {
if (this.connection != null) {
}
} finally {
this.connection = null;
+ this.database = null;
if (isConnected() != isConnected) {
this.propertyChangeSupport.firePropertyChange(
"connected", isConnected, isConnected());
if (!isConnected()) {
throw new NotConnectedException();
}
- return new Database(this);
+ if (this.database == null) {
+ this.database = new Database(this);
+ }
+ return this.database;
}
public DatabaseAdapter getAdapter() {
public String getDisplayName() {
return this.name;
}
+
+ /**
+ * @param query
+ */
+ public void removeQuery(String query) {
+ if (this.queries.remove(query)) {
+ this.propertyChangeSupport.firePropertyChange("queries", null, null);
+ this.changed = true;
+ }
+ }
}