import net.sourceforge.phpdt.sql.adapters.AdapterFactory;
import net.sourceforge.phpdt.sql.adapters.DatabaseAdapter;
-import net.sourceforge.phpdt.sql.adapters.NoSuchAdapterException;
import net.sourceforge.phpdt.sql.sql.MultiSQLServer;
import net.sourceforge.phpdt.sql.sql.SQLResults;
import net.sourceforge.phpdt.sql.view.BookmarkView;
public void run() {
TreeNode node = (TreeNode) view.getCurrent();
String name = null;
- try {
- if (node instanceof SequenceNode) {
- SequenceNode sequence = (SequenceNode) node;
- BookmarkNode parent = (BookmarkNode) sequence.getParent();
- DatabaseAdapter adapter = AdapterFactory.getInstance().getAdapter(parent.getType());
- name = sequence.getName();
- String query = adapter.getNextValue(name);
- MultiSQLServer server = MultiSQLServer.getInstance();
- SQLResults results = server.execute(query);
- TableView.getInstance().loadQuery(results);
- }
- } catch (NoSuchAdapterException e) {
+ if (node instanceof SequenceNode) {
+ SequenceNode sequence = (SequenceNode) node;
+ BookmarkNode parent = (BookmarkNode) sequence.getParent();
+ DatabaseAdapter adapter = AdapterFactory.getInstance().getAdapter(parent.getType());
+ if (adapter == null) return;
+ name = sequence.getName();
+ String query = adapter.getNextValue(name);
+ MultiSQLServer server = MultiSQLServer.getInstance();
+ SQLResults results = server.execute(parent.getConnection(), query);
+ TableView.getInstance().loadQuery(parent, results);
}
}