comparison flys-backend/src/main/java/de/intevation/flys/backend/SedDBCredentials.java @ 5379:61bf64b102bc mapgenfix

Merge with default branch
author Christian Lins <christian.lins@intevation.de>
date Fri, 22 Mar 2013 11:25:54 +0100
parents 92c8f8d1a3ba
children
comparison
equal deleted inserted replaced
5175:cfc5540a4eec 5379:61bf64b102bc
71 "/artifact-database/seddb-database/driver/text()"; 71 "/artifact-database/seddb-database/driver/text()";
72 72
73 public static final String XPATH_URL = 73 public static final String XPATH_URL =
74 "/artifact-database/seddb-database/url/text()"; 74 "/artifact-database/seddb-database/url/text()";
75 75
76 public static final String XPATH_CONNECTION_INIT_SQLS =
77 "/artifact-database/seddb-database/connection-init-sqls/text()";
78
76 public static final String DEFAULT_USER = 79 public static final String DEFAULT_USER =
77 System.getProperty("flys.seddb.user", "seddb"); 80 System.getProperty("flys.seddb.user", "seddb");
78 81
79 public static final String DEFAULT_PASSWORD = 82 public static final String DEFAULT_PASSWORD =
80 System.getProperty("flys.seddb.password", "seddb"); 83 System.getProperty("flys.seddb.password", "seddb");
91 94
92 public static final String DEFAULT_URL = 95 public static final String DEFAULT_URL =
93 System.getProperty( 96 System.getProperty(
94 "flys.seddb.url", 97 "flys.seddb.url",
95 "jdbc:postgresql://localhost:5432/seddb"); 98 "jdbc:postgresql://localhost:5432/seddb");
99
100 public static final String DEFAULT_CONNECTION_INIT_SQLS =
101 System.getProperty(
102 "flys.seddb.connection.init.sqls");
96 103
97 public static final Class [] CLASSES = { 104 public static final Class [] CLASSES = {
98 BezugspegelgewId.class, 105 BezugspegelgewId.class,
99 Bezugspegelgew.class, 106 Bezugspegelgew.class,
100 Bezugspegel.class, 107 Bezugspegel.class,
157 public SedDBCredentials( 164 public SedDBCredentials(
158 String user, 165 String user,
159 String password, 166 String password,
160 String dialect, 167 String dialect,
161 String driver, 168 String driver,
162 String url 169 String url,
170 String connectionInitSqls
163 ) { 171 ) {
164 super(user, password, dialect, driver, url, CLASSES); 172 super(
173 user, password, dialect, driver, url, connectionInitSqls, CLASSES);
165 } 174 }
166 175
167 public static synchronized Credentials getInstance() { 176 public static synchronized Credentials getInstance() {
168 if (instance == null) { 177 if (instance == null) {
169 String user = 178 String user =
174 Config.getStringXPath(XPATH_DIALECT, DEFAULT_DIALECT); 183 Config.getStringXPath(XPATH_DIALECT, DEFAULT_DIALECT);
175 String driver = 184 String driver =
176 Config.getStringXPath(XPATH_DRIVER, DEFAULT_DRIVER); 185 Config.getStringXPath(XPATH_DRIVER, DEFAULT_DRIVER);
177 String url = 186 String url =
178 Config.getStringXPath(XPATH_URL, DEFAULT_URL); 187 Config.getStringXPath(XPATH_URL, DEFAULT_URL);
188 String connectionInitSqls =
189 Config.getStringXPath(
190 XPATH_CONNECTION_INIT_SQLS,
191 DEFAULT_CONNECTION_INIT_SQLS);
179 192
180 instance = new SedDBCredentials( 193 instance = new SedDBCredentials(
181 user, password, dialect, driver, url); 194 user, password, dialect, driver, url, connectionInitSqls);
182 } 195 }
183 return instance; 196 return instance;
184 } 197 }
185 198
186 public static Credentials getDefault() { 199 public static Credentials getDefault() {
187 return new SedDBCredentials( 200 return new SedDBCredentials(
188 DEFAULT_USER, 201 DEFAULT_USER,
189 DEFAULT_PASSWORD, 202 DEFAULT_PASSWORD,
190 DEFAULT_DIALECT, 203 DEFAULT_DIALECT,
191 DEFAULT_DRIVER, 204 DEFAULT_DRIVER,
192 DEFAULT_URL); 205 DEFAULT_URL,
206 DEFAULT_CONNECTION_INIT_SQLS);
193 } 207 }
194 } 208 }
195 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 209 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org