diff src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 197:cdbf2f2dca35

Check for database connectio user parameter for SDE connections.
author raimund renkert <raimund.renkert@intevation.de>
date Wed, 20 Jul 2011 17:56:29 +0200
parents 5350621a0294
children c56547b228f9
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Wed Jul 20 17:51:38 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Wed Jul 20 17:56:29 2011 +0200
@@ -268,10 +268,16 @@
                 layer.setConnectionType(
                 MS_CONNECTION_TYPE.MS_PLUGIN.swigValue(),
                 MS_BINDIR + "/ms/plugins/msplugin_sde_93.dll");
+		String database_auth = layerElement.getAttribute("database");
+		if (database_auth.equals("") || database_auth == null) {
+		    logger.warn("Could not set the database connection user." +
+				" Setting to \"sde\" as default.");
+		    database_auth = "sde";
+		}
                 layer.setConnection(
                 layerElement.getAttribute("server") + "," +
                     "port:" + layerElement.getAttribute("instance") + "," +
-                layerElement.getAttribute("database") + "," +
+                database_auth + "," +
                 layerElement.getAttribute("user") + ",<PASSWORD>");
                 layer.setData(
                     layerElement.getAttribute("data_source") +
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)