comparison flys-aft/src/main/java/de/intevation/db/ConnectionBuilder.java @ 4073:2c70fae83d0c

start syncing at river level. flys-aft/trunk@3406 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 13 Dec 2011 13:41:43 +0000
parents 88f801888d85
children 100c4e0a45e1
comparison
equal deleted inserted replaced
4072:88f801888d85 4073:2c70fae83d0c
27 protected String driver; 27 protected String driver;
28 protected String user; 28 protected String user;
29 protected String password; 29 protected String password;
30 protected String url; 30 protected String url;
31 31
32 protected Statements statements;
33
32 public ConnectionBuilder(String type, Document document) { 34 public ConnectionBuilder(String type, Document document) {
33 this.type = type; 35 this.type = type;
34 extractCredentials(document); 36 extractCredentials(document);
37 statements = new Statements(type, driver != null ? driver : "");
35 } 38 }
36 39
37 protected void extractCredentials(Document document) { 40 protected void extractCredentials(Document document) {
38 HashMap<String, String> map = new HashMap<String, String>(); 41 HashMap<String, String> map = new HashMap<String, String>();
39 map.put("type", type); 42 map.put("type", type);
66 } 69 }
67 } 70 }
68 71
69 return DriverManager.getConnection(url, user, password); 72 return DriverManager.getConnection(url, user, password);
70 } 73 }
74
75 public SymbolicStatement getStatement(String key) {
76 return statements.getStatement(key);
77 }
71 } 78 }
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 79 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org