KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > dbtags > statement > StatementTag


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

16 package org.apache.taglibs.dbtags.statement;
17
18 import java.sql.ResultSet JavaDoc;
19 import java.sql.SQLException JavaDoc;
20
21 import javax.servlet.jsp.JspTagException JavaDoc;
22
23 /**
24  * <p>Interface for StatementImplTag and PreparedStatementImplTag.
25  * Used to mask the differences between statements and preparedstatements
26  * in this taglib.</p>
27  *
28  * @author Morgan Delagrange
29  * @see StatementImplTag
30  * @see org.apache.taglibs.dbtags.preparedstatement.PreparedStatementImplTag
31  * @see QueryTag
32  * @see ExecuteTag
33  * @see org.apache.taglibs.dbtags.resultset.ResultSetTag
34  */

35 public interface StatementTag {
36   
37   /**
38    * SQL query to be executed in the statement
39    *
40    * @param query SQL query
41    * @exception SQLException
42    * throws an exception when a PreparedStatement cannot be created
43    */

44   public void setQuery(String JavaDoc query) throws SQLException JavaDoc, JspTagException JavaDoc;
45
46   /**
47    * The id of a page context attribute containing a java.sql.Connection
48    *
49    * @param connId id of the Connection attribute
50    * @see org.apache.taglibs.dbtags.connection.ConnectionTag
51    */

52   public void setConn(String JavaDoc connId);
53
54   /**
55    * Execute a SQL insert, update or delete.
56    *
57    * @exception SQLException
58    */

59   public void executeUpdate() throws SQLException JavaDoc;
60
61   /**
62    * Execute a SQL select
63    *
64    * @return Resultset based on the {@link #setQuery query}
65    * @exception SQLException
66    */

67   public ResultSet JavaDoc executeQuery() throws SQLException JavaDoc;
68
69   
70 }
71
Popular Tags