KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > contrib > jdbc > IStatement


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.contrib.jdbc;
16
17 import java.sql.ResultSet JavaDoc;
18 import java.sql.SQLException JavaDoc;
19 import java.sql.Statement JavaDoc;
20
21 /**
22  * A wrapper around {@link java.sql.Statement} or
23  * {@link java.sql.PreparedStatement} which hides the differences
24  * between the two.
25  *
26  * @author Howard Lewis Ship
27  * @see org.apache.tapestry.contrib.jdbc.StatementAssembly#createStatement(Connection)
28  *
29  **/

30
31 public interface IStatement
32 {
33     /**
34      * Returns the SQL associated with this statement.
35      *
36      **/

37
38     public String JavaDoc getSQL();
39
40     /**
41      * Returns the underlying {@link java.sql.Statement}
42      * (or {@link java.sql.PreparedStatement}).
43      *
44      **/

45
46     public Statement JavaDoc getStatement();
47
48     /**
49      * Closes the underlying statement, and nulls the reference to it.
50      *
51      **/

52
53     public void close() throws SQLException JavaDoc;
54
55     /**
56      * Executes the statement as a query, returning a {@link ResultSet}.
57      *
58      **/

59
60     public ResultSet JavaDoc executeQuery() throws SQLException JavaDoc;
61
62     /**
63      * Executes the statement as an update, returning the number of rows
64      * affected.
65      *
66      **/

67
68     public int executeUpdate() throws SQLException JavaDoc;
69 }
Popular Tags