From b88616bc6e37ecba2404360426113f72f6c94b30 Mon Sep 17 00:00:00 2001 From: undisclosed <ulrich@vaio> Date: Thu, 19 Oct 2023 18:20:17 +0000 Subject: [PATCH] Link in Readme berichtigt --- src/de/uhilger/baselink/PersistenceManager.java | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/de/uhilger/baselink/PersistenceManager.java b/src/de/uhilger/baselink/PersistenceManager.java index 66d2147..eb12e31 100644 --- a/src/de/uhilger/baselink/PersistenceManager.java +++ b/src/de/uhilger/baselink/PersistenceManager.java @@ -121,6 +121,7 @@ * @throws NamingException when JNDI lookup fails */ public void setDataSourceName(String dataSourceName) throws NamingException { + logger.finest(dataSourceName); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); ds = (DataSource) envCtx.lookup(dataSourceName); @@ -134,14 +135,18 @@ Connection c = null; try { if (dburl != null) { + logger.finest("getting Connection for URL " + dburl); c = DriverManager.getConnection(dburl); } else if(ds != null) { + logger.finest("getting Connection for DataSource " + ds.toString()); c = ds.getConnection(); } else { //throw new SQLException("Unable to get connection, DataSource and database URL are null."); + logger.finest("Unable to get connection, DataSource and database URL are null."); } } catch(Exception ex) { - ex.printStackTrace(); + //ex.printStackTrace(); + logger.log(Level.FINEST, ex.getLocalizedMessage(), ex); } return c; } -- Gitblit v1.9.3