Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.db / org.gvsig.fmap.dal.db.jdbc / src / main / java / org / gvsig / fmap / dal / store / jdbc2 / JDBCHelper.java @ 47787

History | View | Annotate | Download (7.07 KB)

1 45065 jjdelcerro
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2020 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program 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
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24 43020 jjdelcerro
package org.gvsig.fmap.dal.store.jdbc2;
25
26
import java.sql.ResultSet;
27 44682 jjdelcerro
import java.util.List;
28 44644 jjdelcerro
import org.gvsig.expressionevaluator.GeometryExpressionBuilderHelper.GeometrySupportType;
29 44376 jjdelcerro
import org.gvsig.fmap.dal.SQLBuilder;
30 43020 jjdelcerro
import org.gvsig.fmap.dal.exception.DataException;
31
import org.gvsig.fmap.dal.exception.InitializeException;
32 43358 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
33 47787 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureQuery;
34 44191 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureQueryOrder;
35 43020 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureType;
36
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
37
import org.gvsig.fmap.dal.resource.exception.AccessResourceException;
38
import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
39
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
40
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
41 45650 jjdelcerro
import org.gvsig.fmap.dal.spi.DataTransactionServices;
42 43035 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters;
43 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters;
44
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
45
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
46
import org.gvsig.fmap.dal.store.jdbc2.ResulSetControler.ResultSetEntry;
47 46542 fdiaz
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
48
import org.gvsig.fmap.dal.store.jdbc2.spi.SRSSolver;
49 43020 jjdelcerro
import org.gvsig.fmap.geom.Geometry;
50
import org.gvsig.fmap.geom.GeometryManager;
51 44191 jjdelcerro
import org.gvsig.tools.evaluator.Evaluator;
52 43020 jjdelcerro
53
public interface JDBCHelper extends AutoCloseable {
54
55
    /**
56
     * Return the name of the driver.
57
     *
58
     * By default rerturn "JDBC".
59
     *
60
     * @return
61
     */
62
    public String getProviderName();
63
64
    /**
65
     * Indica como deben ser guardadas las geometrias en la BBDD. Pueden
66
     * guardarse en WKT, WKB o EWKB.
67
     *
68
     * @return
69
     */
70
    public GeometrySupportType getGeometrySupportType();
71
72
    /**
73 45152 fdiaz
     * Devuelve un SQLBuilder adaptado al proveedor. Por ejemplo, uno especifico
74 43020 jjdelcerro
     * para PostgreSQL, MySQL, Oracle, MSSQLServer...
75
     *
76
     * @return
77
     */
78
    public JDBCSQLBuilderBase createSQLBuilder();
79
80
    /**
81 45152 fdiaz
     * Devuelve las comillas que han de usaese para los identificadores.
82 43020 jjdelcerro
     *
83
     * @return
84
     */
85
    public String getQuoteForIdentifiers();
86
87
    /**
88 45152 fdiaz
     * Devuelve las comillas que han de usaese en las constantes de cadena.
89 43020 jjdelcerro
     *
90
     * @return
91
     */
92
    public String getQuoteForStrings();
93 45152 fdiaz
94
    public FeatureType getProviderFeatureType();
95
96
    /**
97
     * @param providerFeatureType the providerFeatureType to set
98
     */
99
    public void setProviderFeatureType(FeatureType providerFeatureType);
100 43020 jjdelcerro
101
    /**
102
     * Indica si la BBDD soporta valores automaticos, tipo serial.
103
     *
104
     * @return
105
     */
106
    public boolean allowAutomaticValues();
107
108
    /**
109
     * Indica si la BBDD soporta el uso de OFFSET en la sentencia select.
110
     *
111
     * @return
112
     */
113
    public boolean supportOffsetInSelect();
114
115
    /**
116
     * Indica si se especifico un subquery al abrir el proveedor.
117
     *
118
     * @return
119
     */
120
    public boolean useSubquery();
121
122
    /**
123
     * Indica si la BBDD tiene soporte espacial.
124
     *
125
     * @return
126
     */
127
    public boolean hasSpatialFunctions();
128
129 44198 jjdelcerro
    public boolean supportFilter(FeatureType type, Evaluator evaluator);
130 44191 jjdelcerro
131 46010 jjdelcerro
    public boolean supportExpression(final FeatureType type, String sql);
132 45999 omartinez
133 44198 jjdelcerro
    public boolean supportOrder(FeatureType type, FeatureQueryOrder order);
134 44191 jjdelcerro
135
    public boolean allowNestedOperations();
136 43020 jjdelcerro
    /**
137
     * Indica si podemos escribir el tipo de geometria indicado.
138
     *
139
     * @param geometryType
140
     * @param geometrySubtype
141
     * @return
142
     */
143
    public boolean canWriteGeometry(
144
            int geometryType,
145
            int geometrySubtype
146
    );
147
148 46315 jjdelcerro
    public JDBCConnection getConnection() throws AccessResourceException;
149 43020 jjdelcerro
150 46315 jjdelcerro
    public JDBCConnection getConnectionWritable() throws AccessResourceException;
151 43377 jjdelcerro
152 43035 jjdelcerro
    public String getConnectionURL();
153
154
    public JDBCConnectionParameters getConnectionParameters();
155
156 43020 jjdelcerro
    public GeometryManager getGeometryManager();
157
158
    public ResulSetControler getResulSetControler();
159
160
    public String getSourceId();
161
162
    public ResourceProvider getResource();
163
164
    public void dispose();
165
166
    public void fetchFeature(
167
            FeatureProvider feature,
168 43358 jjdelcerro
            ResultSet rs,
169 44376 jjdelcerro
            FeatureAttributeDescriptor[] columns,
170
            String[] extraValueNames
171 43020 jjdelcerro
    ) throws DataException;
172 43358 jjdelcerro
173 43020 jjdelcerro
    public void fetchFeature(
174
            FeatureProvider feature,
175
            ResultSetEntry rs
176
    ) throws DataException;
177
178
    public Geometry getGeometryFromColumn(
179
            ResultSet rs,
180
            int index
181
    ) throws DataException;
182
183
    public Geometry getGeometryFromColumn(
184
            ResultSetEntry rs,
185
            int index
186
    ) throws DataException;
187
188
    public OperationsFactory getOperations();
189
190
    public FeatureProvider createFeature(
191
            FeatureType featureType
192
    ) throws DataException;
193
194
    public JDBCStoreProvider createProvider(
195
            JDBCStoreParameters parameters,
196
            DataStoreProviderServices providerServices
197
    ) throws InitializeException;
198
199
    public JDBCServerExplorer createServerExplorer(
200
            JDBCServerExplorerParameters parameters,
201
            DataServerExplorerProviderServices providerServices
202
    ) throws InitializeException;
203
204 43606 jjdelcerro
    public SRSSolver getSRSSolver();
205
206 43020 jjdelcerro
    public JDBCNewStoreParameters createNewStoreParameters();
207
208
    public JDBCStoreParameters createOpenStoreParameters();
209
210 45165 jjdelcerro
    public JDBCStoreParameters createOpenStoreParameters(JDBCServerExplorerParameters serverParameters);
211
212 43020 jjdelcerro
    public JDBCServerExplorerParameters createServerExplorerParameters();
213
214
    public String getSourceId(JDBCStoreParameters parameters);
215
216 44198 jjdelcerro
    public boolean isThreadSafe();
217 44376 jjdelcerro
218 44748 jjdelcerro
    public void processSpecialFunctions(
219 44682 jjdelcerro
            SQLBuilder sqlbuilder,
220
            FeatureType type,
221 47787 jjdelcerro
            List<String> extra_column_names, // Output param
222
            FeatureQuery query
223 44682 jjdelcerro
    );
224 45650 jjdelcerro
225
    public void setTransaction(DataTransactionServices transaction);
226 44682 jjdelcerro
227 46104 omartinez
    public void expandCalculedColumns(JDBCSQLBuilderBase sqlbuilder);
228 46120 jjdelcerro
229
    public String getConnectionProviderStatus();
230 46315 jjdelcerro
231
    public DataTransactionServices getTransaction();
232 43020 jjdelcerro
}