KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > accesslayer > StatementsForClassIF


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

17
18 import org.apache.ojb.broker.PersistenceBrokerSQLException;
19
20 import java.sql.PreparedStatement JavaDoc;
21 import java.sql.SQLException JavaDoc;
22 import java.sql.Statement JavaDoc;
23 import java.sql.Connection JavaDoc;
24
25 /**
26   * A class that implements this interface serves as a cache for
27   * <code>java.sql.Statements<code> used for persistence operations
28   * on a given class.
29   * @author brj
30   * @author <a HREF="mailto:rburt3@mchsi.com">Randall Burt</a>
31   * @version $Id: StatementsForClassIF.java,v 1.10.2.2 2005/06/04 14:13:43 arminw Exp $
32   */

33
34 public interface StatementsForClassIF
35 {
36     /**
37      * Returns the DELETE Statement used for clazz.
38      * @return java.sql.PreparedStatement
39      */

40     PreparedStatement JavaDoc getDeleteStmt(Connection JavaDoc con) throws SQLException;
41
42     /**
43      * Returns a generic unprepared Statement used for clazz.
44      * Never use this method for UPDATE/INSERT/DELETE if you want to use the batch mode.
45      * @return java.sql.Statement
46      */

47     Statement JavaDoc getGenericStmt(Connection JavaDoc con, boolean scrollable) throws PersistenceBrokerSQLException;
48
49     /**
50      * Returns the INSERT Statement used for clazz.
51      * @return java.sql.PreparedStatement
52      */

53
54     PreparedStatement JavaDoc getInsertStmt(Connection JavaDoc con) throws SQLException;
55
56     /**
57      * Returns a prepared Statement used for clazz.
58      * @return java.sql.Statement
59      */

60     PreparedStatement JavaDoc getPreparedStmt(Connection JavaDoc con, String JavaDoc sql,
61                                       boolean scrollable, int explicitFetchSizeHint, boolean callableStmt)
62             throws PersistenceBrokerSQLException;
63
64     /**
65      * Returns the SELECT Statement used for clazz.
66      * @return java.sql.PreparedStatement
67      */

68     PreparedStatement JavaDoc getSelectByPKStmt(Connection JavaDoc con) throws SQLException;
69
70     /**
71      * Returns the UPDATE Statement used for clazz.
72      * @return java.sql.PreparedStatement
73      */

74     PreparedStatement JavaDoc getUpdateStmt(Connection JavaDoc con) throws SQLException;
75 }
76
Popular Tags