KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > jdbc > BrokeredConnectionControl


1 /*
2
3    Derby - Class org.apache.derby.iapi.jdbc.BrokeredConnectionControl
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.jdbc;
23
24 import java.sql.SQLException JavaDoc;
25 import java.sql.Statement JavaDoc;
26 import java.sql.PreparedStatement JavaDoc;
27 import java.sql.CallableStatement JavaDoc;
28
29 /**
30     Provides control over a BrokeredConnection
31 */

32 public interface BrokeredConnectionControl
33 {
34     /**
35         Return the real JDBC connection for the brokered connection.
36     */

37     public EngineConnection getRealConnection() throws SQLException JavaDoc;
38
39     /**
40         Notify the control class that a SQLException was thrown
41         during a call on one of the brokered connection's methods.
42     */

43     public void notifyException(SQLException JavaDoc sqle);
44
45
46     /**
47         Allow control over setting auto commit mode.
48     */

49     public void checkAutoCommit(boolean autoCommit) throws SQLException JavaDoc;
50
51     /**
52         Allow control over creating a Savepoint (JDBC 3.0)
53     */

54     public void checkSavepoint() throws SQLException JavaDoc;
55
56     /**
57         Allow control over calling rollback.
58     */

59     public void checkRollback() throws SQLException JavaDoc;
60
61     /**
62         Allow control over calling commit.
63     */

64     public void checkCommit() throws SQLException JavaDoc;
65
66     /**
67         Can cursors be held across commits.
68         @param downgrade true to downgrade the holdability,
69         false to throw an exception.
70     */

71     public int checkHoldCursors(int holdability, boolean downgrade)
72         throws SQLException JavaDoc;
73
74     /**
75         Returns true if isolation level has been set using JDBC/SQL.
76     */

77     public boolean isIsolationLevelSetUsingSQLorJDBC() throws SQLException JavaDoc;
78     /**
79         Reset the isolation level flag used to keep state in
80         BrokeredConnection. It will get set to true when isolation level
81         is set using JDBC/SQL. It will get reset to false at the start
82         and the end of a global transaction.
83     */

84     public void resetIsolationLevelFlag() throws SQLException JavaDoc;
85
86     /**
87         Close called on BrokeredConnection. If this call
88         returns true then getRealConnection().close() will be called.
89     */

90     public boolean closingConnection() throws SQLException JavaDoc;
91
92     /**
93         Optionally wrap a Statement with another Statement.
94     */

95     public Statement JavaDoc wrapStatement(Statement JavaDoc realStatement) throws SQLException JavaDoc;
96
97     /**
98         Optionally wrap a PreparedStatement with another PreparedStatement.
99     */

100     public PreparedStatement JavaDoc wrapStatement(PreparedStatement JavaDoc realStatement, String JavaDoc sql, Object JavaDoc generateKeys) throws SQLException JavaDoc;
101
102     /**
103         Optionally wrap a CallableStatement with an CallableStatement.
104     */

105     public CallableStatement JavaDoc wrapStatement(CallableStatement JavaDoc realStatement, String JavaDoc sql) throws SQLException JavaDoc;
106         
107         /**
108          * Close called on the associated PreparedStatement object
109          * @param statement PreparedStatement object on which the close event
110          * occurred
111          */

112         public void onStatementClose(PreparedStatement JavaDoc statement);
113         
114         /**
115          * Error occurred on associated PreparedStatement object
116          * @param statement PreparedStatement object on which the
117          * error occured
118          * @param sqle The SQLExeption that caused the error
119          */

120         public void onStatementErrorOccurred(PreparedStatement JavaDoc statement,SQLException JavaDoc sqle);
121         
122 }
123
Popular Tags