Revision 28917
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/jdbc/JDBCSetProvider.java | ||
---|---|---|
79 | 79 |
this.store = store; |
80 | 80 |
this.query = query; |
81 | 81 |
this.featureType = featureType; |
82 |
this.helper = store.getHelper(); |
|
82 | 83 |
this.resultSetIDReferenced = new ArrayList(); |
83 | 84 |
|
84 | 85 |
if (query.hasFilter() && this.canFilter()) { |
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/jdbc/JDBCServerExplorer.java | ||
---|---|---|
233 | 233 |
throw new IllegalArgumentException( |
234 | 234 |
"not instance of FilesystemStoreParameters"); |
235 | 235 |
} |
236 |
|
|
237 |
try { |
|
238 |
dsp.validate(); |
|
239 |
} catch (ValidateDataParametersException e) { |
|
240 |
throw new IllegalArgumentException("check parameters", e); |
|
241 |
} |
|
242 |
|
|
243 |
|
|
236 | 244 |
JDBCStoreParameters pgp = (JDBCStoreParameters) dsp; |
237 | 245 |
if (!compare(pgp.getHost(), parameters.getHost())) { |
238 |
throw new IllegalArgumentException("worng explorer: Host"); |
|
246 |
// FIXME Excpetion ??? |
|
247 |
throw new IllegalArgumentException("worng explorer: Host (mine: " |
|
248 |
+ parameters.getHost() + " other:" + pgp.getHost() + ")"); |
|
239 | 249 |
} |
240 | 250 |
if (!compare(pgp.getPort(), parameters.getPort())) { |
241 |
throw new IllegalArgumentException("worng explorer: Port"); |
|
251 |
// FIXME Excpetion ??? |
|
252 |
throw new IllegalArgumentException("worng explorer: Port (mine: " |
|
253 |
+ parameters.getPort() + " other:" + pgp.getPort() + ")"); |
|
242 | 254 |
} |
243 | 255 |
if (!compare(pgp.getDBName(), parameters.getDBName())) { |
244 |
throw new IllegalArgumentException("worng explorer: DBName"); |
|
256 |
// FIXME Excpetion ??? |
|
257 |
throw new IllegalArgumentException("worng explorer: DBName (mine: " |
|
258 |
+ parameters.getDBName() + " other:" + pgp.getDBName() |
|
259 |
+ ")"); |
|
245 | 260 |
} |
246 |
if (!compare(pgp.getCatalog(), parameters.getCatalog())) { |
|
247 |
throw new IllegalArgumentException("worng explorer: Catalog"); |
|
261 |
if (parameters.getCatalog() != null) { |
|
262 |
// implicit catalog |
|
263 |
if (!compare(pgp.getCatalog(), parameters.getCatalog())) { |
|
264 |
// FIXME Excpetion ??? |
|
265 |
throw new IllegalArgumentException( |
|
266 |
"worng explorer: Catalog (mine: " |
|
267 |
+ parameters.getCatalog() + " other:" |
|
268 |
+ pgp.getCatalog() + ")"); |
|
269 |
} |
|
248 | 270 |
} |
249 |
if (!compare(pgp.getSchema(), parameters.getSchema())) { |
|
250 |
throw new IllegalArgumentException("worng explorer: Schema"); |
|
271 |
if (parameters.getSchema() != null) { |
|
272 |
// implicit schema |
|
273 |
if (!compare(pgp.getSchema(), parameters.getSchema())) { |
|
274 |
// FIXME Excpetion ??? |
|
275 |
throw new IllegalArgumentException( |
|
276 |
"worng explorer: Schema (mine: " |
|
277 |
+ parameters.getSchema() + " other:" |
|
278 |
+ pgp.getSchema() + ")"); |
|
279 |
} |
|
251 | 280 |
} |
252 | 281 |
if (!compare(pgp.getJDBCDriverClassName(), parameters |
253 | 282 |
.getJDBCDriverClassName())) { |
283 |
// FIXME Excpetion ??? |
|
254 | 284 |
throw new IllegalArgumentException( |
255 | 285 |
"worng explorer: JDBCDriverClassName"); |
256 | 286 |
} |
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/postgresql/PostgreSQLServerExplorer.java | ||
---|---|---|
88 | 88 |
return NAME; |
89 | 89 |
} |
90 | 90 |
|
91 |
protected String getSQLForList(int mode, boolean showInformationDBTables) { |
|
92 |
StringBuffer sqlBuf = new StringBuffer(); |
|
93 |
sqlBuf |
|
94 |
.append("SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, false as ISVIEW "); |
|
95 |
sqlBuf.append(" FROM INFORMATION_SCHEMA.TABLES "); |
|
96 |
sqlBuf.append(" xxWHERExx "); |
|
97 |
sqlBuf.append(" union "); |
|
98 |
sqlBuf |
|
99 |
.append("SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, true as ISVIEW "); |
|
100 |
sqlBuf.append(" FROM INFORMATION_SCHEMA.VIEWS "); |
|
101 |
sqlBuf.append(" xxWHERExx "); |
|
102 |
|
|
103 |
if (showInformationDBTables) { |
|
104 |
return sqlBuf.toString().replaceAll("xxWHERExx", ""); |
|
105 |
} else { |
|
106 |
return sqlBuf |
|
107 |
.toString() |
|
108 |
.replaceAll("xxWHERExx", |
|
109 |
"WHERE TABLE_SCHEMA NOT IN ('information_schema','pg_catalog')"); |
|
110 |
|
|
111 |
} |
|
112 |
|
|
113 |
} |
|
114 |
|
|
115 | 91 |
protected JDBCStoreParameters createStoreParams() |
116 | 92 |
throws InitializeException, ProviderNotRegisteredException { |
117 | 93 |
PostgreSQLStoreParameters orgParams = (PostgreSQLStoreParameters) super |
... | ... | |
242 | 218 |
} |
243 | 219 |
|
244 | 220 |
|
221 |
protected String getSQLForList(int mode, boolean showInformationDBTables) { |
|
222 |
StringBuffer sqlBuf = new StringBuffer(); |
|
223 |
sqlBuf |
|
224 |
.append("SELECT null as TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, false as ISVIEW "); |
|
225 |
sqlBuf.append(" FROM INFORMATION_SCHEMA.TABLES "); |
|
226 |
sqlBuf.append(" xxWHERExx "); |
|
227 |
sqlBuf.append(" union "); |
|
228 |
sqlBuf |
|
229 |
.append("SELECT null as TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, true as ISVIEW "); |
|
230 |
sqlBuf.append(" FROM INFORMATION_SCHEMA.VIEWS "); |
|
231 |
sqlBuf.append(" xxWHERExx "); |
|
232 |
|
|
233 |
if (showInformationDBTables) { |
|
234 |
return sqlBuf.toString().replaceAll("xxWHERExx", ""); |
|
235 |
} else { |
|
236 |
return sqlBuf |
|
237 |
.toString() |
|
238 |
.replaceAll("xxWHERExx", |
|
239 |
"WHERE TABLE_SCHEMA NOT IN ('information_schema','pg_catalog')"); |
|
240 |
|
|
241 |
} |
|
242 |
|
|
243 |
|
|
244 |
} |
|
245 | 245 |
} |
Also available in: Unified diff