View Javadoc

1   /*
2    * Copyright 2002,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  
17  package javax.servlet.jsp.jstl.sql;
18  
19  /***
20   * <p>This interface allows tag handlers implementing it to receive
21   * values for parameter markers ("?") in their SQL statements.</p>
22   *
23   * <p>This interface is implemented by both &lt;sql:query&gt; and
24   * &lt;sql:update&gt;. Its <code>addSQLParameter()</code> method
25   * is called by nested parameter actions (such as &lt;sql:param&gt;)
26   * to substitue <code>PreparedStatement<code> parameter values for
27   * "?" parameter markers in the SQL statement of the enclosing
28   * <code>SQLExecutionTag</code> action.</p>
29   *
30   * <p>The given parameter values are converted to their corresponding
31   * SQL type (following the rules in the JDBC specification) before
32   * they are sent to the database.</p>
33   *
34   * <p>Keeing track of the index of the parameter values being added
35   * is the responsibility of the tag handler implementing this
36   * interface</p>
37   *
38   * <p>The <code>SQLExcecutionTag</code> interface is exposed in order
39   * to support custom parameter actions which may retrieve their
40   * parameters from any source and process them before substituting
41   * them for a parameter marker in the sQL statement of the
42   * enclosing <code>SQLExecutionTag</code> action</p>
43   *
44   * @author Justyna Horwat
45   */
46  public interface SQLExecutionTag {
47  
48      /***
49       * Adds a PreparedStatement parameter value
50       *
51       * @param the PreparedStatement parameter value
52       */
53      public void addSQLParameter(Object value);
54  }