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