1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
if (dataSource == null) {
try {
logger.debug("getInstance for Get connection -> new InitDatasource");
ctx = new InitialContext();
logger.debug("getInstance for Get connection -> new InitDatasource--context Initialisé");
dataSource = (javax.sql.DataSource) ctx
.lookup("java:comp/env/jdbc/dataSource");
logger.debug("getInstance for Get connection -> END InitDatasource");
} catch (NamingException e) {
logger.error("getDataSource", e);
throw new ConfigurationException(e.getMessage());
} finally {
try {
ctx.close();
} catch (Exception e) {
}
}
} |
Partager