01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package javax.sql;
19:
20: import java.sql.SQLException;
21:
22: /**
23: * An interface which provides functionality for a disconnected RowSet to put
24: * data updates back to the data source from which the RowSet was originally
25: * populated. An object implementing this interface is called a Writer.
26: * <p>
27: * The Writer must establish a connection to the RowSet's data source before
28: * writing the data. The RowSet calling this interface must implement the
29: * RowSetInternal interface.
30: * <p>
31: * The Writer may encounter a situation where the updated data being written
32: * back to the data source has already been updated in the data source. How a
33: * conflict of this kind is handled is determined by the implementation of the
34: * Writer.
35: */
36: public interface RowSetWriter {
37:
38: /**
39: * Writes changes in the RowSet associated with this RowSetWriter back to
40: * its data source.
41: *
42: * @param theRowSet
43: * the RowSet object. This RowSet must a) Implement the
44: * RowSetInternal interface and b) have have this RowSetWriter
45: * registered with it and c) must call this method internally
46: * @return true if the modified data was written, false otherwise (which
47: * typically implies some form of conflict)
48: * @throws SQLException
49: * if a problem occurs accessing the database
50: */
51: public boolean writeData(RowSetInternal theRowSet)
52: throws SQLException;
53: }
|