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 @ 44198

History | View | Annotate | Download (5.25 KB)

1 43020 jjdelcerro
package org.gvsig.fmap.dal.store.jdbc2;
2
3
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
4
import java.sql.Connection;
5
import java.sql.ResultSet;
6 44042 jjdelcerro
import org.gvsig.expressionevaluator.ExpressionBuilder.GeometrySupportType;
7 43020 jjdelcerro
import org.gvsig.fmap.dal.exception.DataException;
8
import org.gvsig.fmap.dal.exception.InitializeException;
9 43358 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
10 44191 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureQueryOrder;
11 44198 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureStore;
12 43020 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureType;
13
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
14
import org.gvsig.fmap.dal.resource.exception.AccessResourceException;
15
import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
16
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
17
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
18 43035 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters;
19 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters;
20
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
21
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
22
import org.gvsig.fmap.dal.store.jdbc2.ResulSetControler.ResultSetEntry;
23
import org.gvsig.fmap.geom.Geometry;
24
import org.gvsig.fmap.geom.GeometryManager;
25 43606 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc2.spi.SRSSolver;
26 44191 jjdelcerro
import org.gvsig.tools.evaluator.Evaluator;
27 43020 jjdelcerro
28
public interface JDBCHelper extends AutoCloseable {
29
30
    /**
31
     * Return the name of the driver.
32
     *
33
     * By default rerturn "JDBC".
34
     *
35
     * @return
36
     */
37
    public String getProviderName();
38
39
    /**
40
     * Indica como deben ser guardadas las geometrias en la BBDD. Pueden
41
     * guardarse en WKT, WKB o EWKB.
42
     *
43
     * @return
44
     */
45
    public GeometrySupportType getGeometrySupportType();
46
47
    /**
48
     * Devuelbe un SQLBuilder adaptado al proveedor. Por ejemplo, uno especifico
49
     * para PostgreSQL, MySQL, Oracle, MSSQLServer...
50
     *
51
     * @return
52
     */
53
    public JDBCSQLBuilderBase createSQLBuilder();
54
55
    /**
56
     * Devueble las comillas que han de usaese para los identificadores.
57
     *
58
     * @return
59
     */
60
    public String getQuoteForIdentifiers();
61
62
    /**
63
     * Devueble las comillas que han de usaese en las constantes de cadena.
64
     *
65
     * @return
66
     */
67
    public String getQuoteForStrings();
68
69
    /**
70
     * Indica si la BBDD soporta valores automaticos, tipo serial.
71
     *
72
     * @return
73
     */
74
    public boolean allowAutomaticValues();
75
76
    /**
77
     * Indica si la BBDD soporta el uso de OFFSET en la sentencia select.
78
     *
79
     * @return
80
     */
81
    public boolean supportOffsetInSelect();
82
83
    /**
84
     * Indica si se especifico un subquery al abrir el proveedor.
85
     *
86
     * @return
87
     */
88
    public boolean useSubquery();
89
90
    /**
91
     * Indica si la BBDD tiene soporte espacial.
92
     *
93
     * @return
94
     */
95
    public boolean hasSpatialFunctions();
96
97 44198 jjdelcerro
    public boolean supportFilter(FeatureType type, Evaluator evaluator);
98 44191 jjdelcerro
99 44198 jjdelcerro
    public boolean supportOrder(FeatureType type, FeatureQueryOrder order);
100 44191 jjdelcerro
101
    public boolean allowNestedOperations();
102 43020 jjdelcerro
    /**
103
     * Indica si podemos escribir el tipo de geometria indicado.
104
     *
105
     * @param geometryType
106
     * @param geometrySubtype
107
     * @return
108
     */
109
    public boolean canWriteGeometry(
110
            int geometryType,
111
            int geometrySubtype
112
    );
113
114
    public Connection getConnection() throws AccessResourceException;
115
116 43377 jjdelcerro
    public Connection getConnectionWritable() throws AccessResourceException;
117
118 43035 jjdelcerro
    public String getConnectionURL();
119
120
    public JDBCConnectionParameters getConnectionParameters();
121
122 44191 jjdelcerro
    public void closeConnection(Connection connection);
123 43020 jjdelcerro
124 44191 jjdelcerro
    public void closeConnectionQuietly(Connection connection);
125
126 43020 jjdelcerro
    public GeometryManager getGeometryManager();
127
128
    public ResulSetControler getResulSetControler();
129
130
    public String getSourceId();
131
132
    public ResourceProvider getResource();
133
134
    public void dispose();
135
136
    public void fetchFeature(
137
            FeatureProvider feature,
138 43358 jjdelcerro
            ResultSet rs,
139
            FeatureAttributeDescriptor[] columns
140 43020 jjdelcerro
    ) throws DataException;
141 43358 jjdelcerro
142 43020 jjdelcerro
    public void fetchFeature(
143
            FeatureProvider feature,
144
            ResultSetEntry rs
145
    ) throws DataException;
146
147
    public Geometry getGeometryFromColumn(
148
            ResultSet rs,
149
            int index
150
    ) throws DataException;
151
152
    public Geometry getGeometryFromColumn(
153
            ResultSetEntry rs,
154
            int index
155
    ) throws DataException;
156
157
    public OperationsFactory getOperations();
158
159
    public FeatureProvider createFeature(
160
            FeatureType featureType
161
    ) throws DataException;
162
163
    public JDBCStoreProvider createProvider(
164
            JDBCStoreParameters parameters,
165
            DataStoreProviderServices providerServices
166
    ) throws InitializeException;
167
168
    public JDBCServerExplorer createServerExplorer(
169
            JDBCServerExplorerParameters parameters,
170
            DataServerExplorerProviderServices providerServices
171
    ) throws InitializeException;
172
173 43606 jjdelcerro
    public SRSSolver getSRSSolver();
174
175 43020 jjdelcerro
    public JDBCNewStoreParameters createNewStoreParameters();
176
177
    public JDBCStoreParameters createOpenStoreParameters();
178
179
    public JDBCServerExplorerParameters createServerExplorerParameters();
180
181
    public String getSourceId(JDBCStoreParameters parameters);
182
183 44198 jjdelcerro
    public boolean isThreadSafe();
184 43020 jjdelcerro
}