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