Revision 28917 branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/jdbc/JDBCServerExplorer.java

View differences:

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
		}

Also available in: Unified diff