01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data.jdbc;
17:
18: import java.sql.Connection;
19:
20: import org.geotools.data.store.ContentEntry;
21: import org.geotools.data.store.ContentState;
22:
23: /**
24: * Functions as the State for a JDBCFeatureSource (all fields should be here).
25: *
26: * @author Jody Garnett, Refractions Research Inc.
27: * @author Justin Deoliveira, The Open Planning Project
28: */
29: public final class JDBCState extends ContentState {
30: private Connection connection;
31:
32: /**
33: * Duplicates provided JDBCState .. for everything except connection & listeners.
34: */
35: public JDBCState(JDBCState state) {
36: super (state);
37: }
38:
39: public JDBCState(ContentEntry entry) {
40: super (entry);
41: }
42:
43: public Connection getConnection() {
44: return connection;
45: }
46:
47: public void setConnection(Connection connection) {
48: this .connection = connection;
49: }
50:
51: public void flush() {
52: connection = null;
53: super.flush();
54: }
55: }
|