01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.command;
07:
08: import java.sql.SQLException;
09:
10: import org.h2.result.ResultInterface;
11: import org.h2.util.ObjectArray;
12:
13: /**
14: * Represents a SQL statement.
15: */
16: public interface CommandInterface {
17:
18: /**
19: * Check if this is a query.
20: *
21: * @return true if it is a query
22: */
23: boolean isQuery();
24:
25: /**
26: * Get the parameters (if any).
27: *
28: * @return the parameters
29: */
30: ObjectArray getParameters();
31:
32: /**
33: * Execute the query.
34: *
35: * @param maxRows the maximum number of rows returned
36: * @param scrollable if the result set must be scrollable
37: * @return the result
38: */
39: ResultInterface executeQuery(int maxRows, boolean scrollable)
40: throws SQLException;
41:
42: /**
43: * Execute the statement
44: *
45: * @return the update count
46: */
47: int executeUpdate() throws SQLException;
48:
49: /**
50: * Close the statement.
51: */
52: void close();
53:
54: /**
55: * Cancel the statement if it is still processing.
56: */
57: void cancel();
58:
59: /**
60: * Get an empty result set containing the meta data of the result.
61: *
62: * @return the empty result
63: */
64: ResultInterface getMetaData() throws SQLException;
65: }
|