1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5 *
6 * The contents of this file are subject to the terms of either the GNU
7 * General Public License Version 2 only ("GPL") or the Common Development
8 * and Distribution License("CDDL") (collectively, the "License"). You
9 * may not use this file except in compliance with the License. You can obtain
10 * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
11 * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
12 * language governing permissions and limitations under the License.
13 *
14 * When distributing the software, include this License Header Notice in each
15 * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
16 * Sun designates this particular file as subject to the "Classpath" exception
17 * as provided by Sun in the GPL Version 2 section of the License file that
18 * accompanied this code. If applicable, add the following below the License
19 * Header, with the fields enclosed by brackets [] replaced by your own
20 * identifying information: "Portions Copyrighted [year]
21 * [name of copyright owner]"
22 *
23 * Contributor(s):
24 *
25 * If you wish your version of this file to be governed by only the CDDL or
26 * only the GPL Version 2, indicate your decision by adding "[Contributor]
27 * elects to include this software in this distribution under the [CDDL or GPL
28 * Version 2] license." If you don't indicate a single choice of license, a
29 * recipient has the option to distribute your version of this file under
30 * either the CDDL, the GPL Version 2 or to extend the choice of license to
31 * its licensees as provided above. However, if you add GPL Version 2 code
32 * and therefore, elected the GPL Version 2 license, then the option applies
33 * only if the new code is made subject to such option by the copyright
34 * holder.
35 */
36
37 package javax.resource.cci;
38
39
40 import javax.resource.ResourceException;
41
42 /** The interface <code>javax.resource.cci.ResultSetInfo</code> provides
43 * information on the support provided for ResultSet by a connected
44 * EIS instance. A component calls the method
45 * <code>Connection.getResultInfo</code> to get the ResultSetInfo instance.
46 *
47 * <p>A CCI implementation is not required to support
48 * <code>javax.resource.cci.ResultSetInfo</code> interface. The
49 * implementation of this interface is provided only if the CCI
50 * supports the ResultSet facility.
51 *
52 * @version 0.9
53 * @author Rahul Sharma
54 * @see javax.resource.cci.Connection
55 * @see java.sql.ResultSet
56 * @see javax.resource.cci.ConnectionMetaData
57 **/
58
59 public interface ResultSetInfo {
60
61 /** Indicates whether or not a visible row update can be detected
62 * by calling the method <code>ResultSet.rowUpdated</code>.
63 *
64 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
65 * @return true if changes are detected by the result set
66 * type; false otherwise
67 * @see java.sql.ResultSet#rowUpdated
68 * @throws ResourceException Failed to get the information
69 **/
70 public
71 boolean updatesAreDetected(int type) throws ResourceException;
72
73 /** Indicates whether or not a visible row insert can be detected
74 * by calling ResultSet.rowInserted.
75 *
76 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
77 * @return true if changes are detected by the result set
78 * type; false otherwise
79 * @see java.sql.ResultSet#rowInserted
80 * @throws ResourceException Failed to get the information
81 **/
82 public
83 boolean insertsAreDetected(int type) throws ResourceException;
84
85 /* Indicates whether or not a visible row delete can be detected by
86 * calling ResultSet.rowDeleted. If deletesAreDetected
87 * returns false, then deleted rows are removed from the ResultSet.
88 *
89 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
90 * @return true if changes are detected by the result set
91 * type; false otherwise
92 * @see java.sql.ResultSet#rowDeleted
93 * @throws ResourceException Failed to get the information
94 **/
95 public
96 boolean deletesAreDetected(int type) throws ResourceException;
97
98 /** Indicates whether or not a resource adapter supports a type
99 * of ResultSet.
100 *
101 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
102 * @return true if ResultSet type supported; false otherwise
103 * @throws ResourceException Failed to get the information
104 **/
105 public
106 boolean supportsResultSetType(int type) throws ResourceException;
107
108 /** Indicates whether or not a resource adapter supports the
109 * concurrency type in combination with the given ResultSet type/
110 *
111 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
112 * @param concurrency ResultSet concurrency type defined in
113 * java.sql.ResultSet
114 * @return true if the specified combination supported; false otherwise
115 * @throws ResourceException Failed to get the information
116 **/
117 public
118 boolean supportsResultTypeConcurrency(int type,
119 int concurrency)
120 throws ResourceException;
121
122
123 /** Indicates whether updates made by others are visible.
124 *
125 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
126 * @return true if updates by others are visible for the
127 * ResultSet type; false otherwise
128 * @throws ResourceException Failed to get the information
129 */
130 public
131 boolean othersUpdatesAreVisible(int type) throws ResourceException;
132
133 /**
134 * Indicates whether deletes made by others are visible.
135 *
136 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
137 * @return true if deletes by others are visible for the
138 * ResultSet type; false otherwise
139 * @throws ResourceException Failed to get the information
140 */
141 public
142 boolean othersDeletesAreVisible(int type) throws ResourceException;
143
144 /**
145 * Indicates whether inserts made by others are visible.
146 *
147 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
148 * @return true if inserts by others are visible for the
149 * ResultSet type; false otherwise
150 * @throws ResourceException Failed to get the information
151 */
152 public
153 boolean othersInsertsAreVisible(int type) throws ResourceException;
154
155
156 /* Indicates whether a ResultSet's own updates are visible.
157 *
158 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
159 * @return true if updates are visible for the ResultSet
160 * type; false otherwise
161 * @throws ResourceException Failed to get the information
162 **/
163 public
164 boolean ownUpdatesAreVisible(int type) throws ResourceException;
165
166 /* Indicates whether a ResultSet's own inserts are visible.
167 *
168 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
169 * @return true if inserts are visible for the ResultSet
170 * type; false otherwise
171 * @throws ResourceException Failed to get the information
172 **/
173 public
174 boolean ownInsertsAreVisible(int type) throws ResourceException;
175
176 /* Indicates whether a ResultSet's own deletes are visible.
177 *
178 * @param type type of the ResultSet i.e. ResultSet.TYPE_XXX
179 * @return true if inserts are visible for the ResultSet
180 * type; false otherwise
181 * @throws ResourceException Failed to get the information
182 **/
183 public
184 boolean ownDeletesAreVisible(int type) throws ResourceException;
185
186 }