1 | /* |
2 | |
3 | Derby - Class org.apache.derby.impl.tools.ij.ijMultiResult |
4 | |
5 | Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.impl.tools.ij; |
22 | |
23 | import java.sql.Connection; |
24 | import java.sql.ResultSet; |
25 | import java.sql.Statement; |
26 | import java.sql.SQLException; |
27 | import java.sql.SQLWarning; |
28 | import java.util.Vector; |
29 | |
30 | /** |
31 | * This is an impl for a statement execution; the result |
32 | * is either an update count or result set depending |
33 | * on what was executed. |
34 | * |
35 | * @author ames |
36 | */ |
37 | class ijMultiResult extends ijResultImpl { |
38 | |
39 | private Statement statement; |
40 | private ResultSet rs; |
41 | boolean closeWhenDone; |
42 | |
43 | ijMultiResult(Statement s, ResultSet rs, boolean c) { |
44 | statement = s; |
45 | this.rs = rs; |
46 | closeWhenDone = c; |
47 | } |
48 | |
49 | public boolean isMulti() { return true; } |
50 | |
51 | public Statement getStatement() { return statement; } |
52 | public ResultSet getResultSet() { return rs; } |
53 | public void closeStatement() throws SQLException { if (closeWhenDone) statement.close(); } |
54 | |
55 | public SQLWarning getSQLWarnings() { return null; } |
56 | public void clearSQLWarnings() { } |
57 | } |