01: /*
02: * StatementRunner.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.interfaces;
13:
14: import java.sql.SQLException;
15: import workbench.db.WbConnection;
16: import workbench.sql.StatementRunnerResult;
17: import workbench.storage.RowActionMonitor;
18:
19: /**
20: * @author support@sql-workbench.net
21: */
22: public interface StatementRunner {
23:
24: Connectable getConnectionClient();
25:
26: void setConnectionClient(Connectable client);
27:
28: WbConnection getConnection();
29:
30: void setConnection(WbConnection aConn);
31:
32: void setExecutionController(ExecutionController control);
33:
34: StatementRunnerResult getResult();
35:
36: void setResultLogger(ResultLogger logger);
37:
38: void setParameterPrompter(ParameterPrompter filter);
39:
40: void runStatement(String aSql, int maxRows, int queryTimeout)
41: throws SQLException, Exception;
42:
43: void setVerboseLogging(boolean flag);
44:
45: boolean getVerboseLogging();
46:
47: void cancel();
48:
49: void done();
50:
51: void setRowMonitor(RowActionMonitor monitor);
52:
53: void statementDone();
54:
55: void setBaseDir(String dir);
56:
57: String getBaseDir();
58:
59: void setFullErrorReporting(boolean flag);
60:
61: boolean getIgnoreDropErrors();
62:
63: void setIgnoreDropErrors(boolean flag);
64:
65: void setSavepoint();
66:
67: void rollbackSavepoint();
68:
69: void releaseSavepoint();
70:
71: void setUseSavepoint(boolean flag);
72:
73: void dispose();
74:
75: public class Factory {
76: public static StatementRunner createRunner() {
77: try {
78: // Use reflection to create instance to avoid class loading upon startup
79: return (StatementRunner) Class.forName(
80: "workbench.sql.DefaultStatementRunner")
81: .newInstance();
82: } catch (Exception e) {
83: return null;
84: }
85: }
86: }
87: }
|