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

History | View | Annotate | Download (4.46 KB)

1
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
import org.cresques.cts.IProjection;
7
import org.gvsig.fmap.dal.exception.DataException;
8
import org.gvsig.fmap.dal.exception.InitializeException;
9
import org.gvsig.fmap.dal.ExpressionBuilder.GeometrySupportType;
10
import org.gvsig.fmap.dal.feature.FeatureType;
11
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
12
import org.gvsig.fmap.dal.resource.exception.AccessResourceException;
13
import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
14
import org.gvsig.fmap.dal.spi.DataServerExplorerProviderServices;
15
import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
16
import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters;
17
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
18
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
19
import org.gvsig.fmap.dal.store.jdbc2.ResulSetControler.ResultSetEntry;
20
import org.gvsig.fmap.geom.Geometry;
21
import org.gvsig.fmap.geom.GeometryManager;
22

    
23
public interface JDBCHelper extends AutoCloseable {
24

    
25
    /**
26
     * Return the name of the driver.
27
     * 
28
     * By default rerturn "JDBC".
29
     * 
30
     * @return 
31
     */
32
    public String getProviderName();
33
    
34
    /**
35
     * Indica como deben ser guardadas las geometrias en la BBDD. Pueden
36
     * guardarse en WKT, WKB o EWKB.
37
     *
38
     * @return
39
     */
40
    public GeometrySupportType getGeometrySupportType();
41

    
42
    /**
43
     * Devuelbe un SQLBuilder adaptado al proveedor. Por ejemplo, uno especifico
44
     * para PostgreSQL, MySQL, Oracle, MSSQLServer...
45
     *
46
     * @return
47
     */
48
    public JDBCSQLBuilderBase createSQLBuilder();
49

    
50
    /**
51
     * Devueble las comillas que han de usaese para los identificadores.
52
     *
53
     * @return
54
     */
55
    public String getQuoteForIdentifiers();
56

    
57
    /**
58
     * Devueble las comillas que han de usaese en las constantes de cadena.
59
     *
60
     * @return
61
     */
62
    public String getQuoteForStrings();
63

    
64
    /**
65
     * Indica si la BBDD soporta valores automaticos, tipo serial.
66
     *
67
     * @return
68
     */
69
    public boolean allowAutomaticValues();
70

    
71
    /**
72
     * Indica si la BBDD soporta el uso de OFFSET en la sentencia select.
73
     *
74
     * @return
75
     */
76
    public boolean supportOffsetInSelect();
77

    
78
    /**
79
     * Indica si se especifico un subquery al abrir el proveedor.
80
     *
81
     * @return
82
     */
83
    public boolean useSubquery();
84

    
85
    /**
86
     * Indica si la BBDD tiene soporte espacial.
87
     *
88
     * @return
89
     */
90
    public boolean hasSpatialFunctions();
91

    
92
    /**
93
     * Indica si podemos escribir el tipo de geometria indicado.
94
     *
95
     * @param geometryType
96
     * @param geometrySubtype
97
     * @return
98
     */
99
    public boolean canWriteGeometry(
100
            int geometryType, 
101
            int geometrySubtype
102
    );
103

    
104
    public Connection getConnection() throws AccessResourceException;
105

    
106
    public void closeConnection(
107
            Connection connection
108
    );
109

    
110
    public GeometryManager getGeometryManager();
111

    
112
    public ResulSetControler getResulSetControler();
113

    
114
    public String getSourceId();
115

    
116
    public ResourceProvider getResource();
117

    
118
    public void dispose();
119

    
120
    public void fetchFeature(
121
            FeatureProvider feature, 
122
            ResultSet rs
123
    ) throws DataException;
124

    
125
    public void fetchFeature(
126
            FeatureProvider feature, 
127
            ResultSetEntry rs
128
    ) throws DataException;
129

    
130
    public Geometry getGeometryFromColumn(
131
            ResultSet rs, 
132
            int index
133
    ) throws DataException;
134

    
135
    public Geometry getGeometryFromColumn(
136
            ResultSetEntry rs, 
137
            int index
138
    ) throws DataException;
139

    
140
    public OperationsFactory getOperations();
141

    
142
    public FeatureProvider createFeature(
143
            FeatureType featureType
144
    ) throws DataException;
145

    
146
    public JDBCStoreProvider createProvider(
147
            JDBCStoreParameters parameters,
148
            DataStoreProviderServices providerServices
149
    ) throws InitializeException;
150

    
151
    public JDBCServerExplorer createServerExplorer(
152
            JDBCServerExplorerParameters parameters, 
153
            DataServerExplorerProviderServices providerServices
154
    ) throws InitializeException;
155

    
156
    public int getSRSCode(IProjection crs);
157

    
158
    public JDBCNewStoreParameters createNewStoreParameters();
159

    
160
    public JDBCStoreParameters createOpenStoreParameters();
161
    
162
    public JDBCServerExplorerParameters createServerExplorerParameters();
163

    
164
    public String getSourceId(JDBCStoreParameters parameters);
165

    
166
}