|
|
@ -77,6 +77,15 @@ public class WindowsDAOFactory extends AbstractMobileDeviceManagementDAOFactory
|
|
|
|
if (currentConnection.get() == null) {
|
|
|
|
if (currentConnection.get() == null) {
|
|
|
|
Connection conn;
|
|
|
|
Connection conn;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (dataSource == null) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String dataSourceName = "jdbc/MobileWindowsDM_DS";
|
|
|
|
|
|
|
|
Context ctx = new InitialContext();
|
|
|
|
|
|
|
|
dataSource = (DataSource) ctx.lookup(dataSourceName);
|
|
|
|
|
|
|
|
} catch (NamingException e) {
|
|
|
|
|
|
|
|
throw new MobileDeviceManagementDAOException("Error occurred while initializing datasource", e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
conn = dataSource.getConnection();
|
|
|
|
conn = dataSource.getConnection();
|
|
|
|
currentConnection.set(conn);
|
|
|
|
currentConnection.set(conn);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|