01: /*
02: * WbListCatalogs.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.sql.wbcommands;
13:
14: import java.sql.SQLException;
15:
16: import workbench.sql.SqlCommand;
17: import workbench.sql.StatementRunnerResult;
18: import workbench.storage.DataStore;
19:
20: /**
21: *
22: * @author support@sql-workbench.net
23: */
24: public class WbListCatalogs extends SqlCommand {
25: private final String VERB;
26:
27: public static final WbListCatalogs LISTDB = new WbListCatalogs(
28: "WBLISTDB");
29: public static final WbListCatalogs LISTCAT = new WbListCatalogs(
30: "WBLISTCAT");
31:
32: private WbListCatalogs(String verb) {
33: this .VERB = verb;
34: }
35:
36: public String getVerb() {
37: return VERB;
38: }
39:
40: public StatementRunnerResult execute(String aSql)
41: throws SQLException {
42: StatementRunnerResult result = new StatementRunnerResult();
43: DataStore ds = currentConnection.getMetadata()
44: .getCatalogInformation();
45: result.addDataStore(ds);
46: result.setSuccess();
47: return result;
48: }
49:
50: }
|