changeset 2362:2649151c9500

Added some functions that return information about the db connection used by the current database session. flys-backend/trunk@3198 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 09 Nov 2011 14:59:01 +0000
parents e9b0fd1de89d
children a8f408fdf58c
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java
diffstat 2 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Wed Nov 09 10:31:08 2011 +0000
+++ b/flys-backend/ChangeLog	Wed Nov 09 14:59:01 2011 +0000
@@ -1,3 +1,9 @@
+2011-11-09  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java:
+	  Added methods that return information about the database connection used
+	  by a concrete SessionFactoryImpl.
+
 2011-11-09  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/model/Floodplain.java: Changed the
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java	Wed Nov 09 10:31:08 2011 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/backend/SessionFactoryProvider.java	Wed Nov 09 14:59:01 2011 +0000
@@ -270,10 +270,28 @@
     }
 
 
-    public static String getDriver(SessionFactoryImpl factory) {
+    public static String getProperty(SessionFactoryImpl factory, String key) {
         Properties props = factory.getProperties();
+        return props.getProperty(key);
+    }
 
-        return props.getProperty(Environment.DRIVER);
+    public static String getUser(SessionFactoryImpl factory) {
+        return getProperty(factory, Environment.USER);
+    }
+
+
+    public static String getPass(SessionFactoryImpl factory) {
+        return getProperty(factory, Environment.PASS);
+    }
+
+
+    public static String getURL(SessionFactoryImpl factory) {
+        return getProperty(factory, Environment.URL);
+    }
+
+
+    public static String getDriver(SessionFactoryImpl factory) {
+        return getProperty(factory, Environment.DRIVER);
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org