Fix windows enrollment issue

revert-dabc3590
Pahansith 6 years ago
parent 4226755991
commit b04acfdf53

@ -16,7 +16,6 @@ public class WindowsTokenServiceImpl implements WindowsTokenService {
public WindowsTokenServiceImpl() {
windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl();
WindowsDAOFactory windowsDAOFactory = new WindowsDAOFactory();
}
@Override

@ -77,6 +77,15 @@ public class WindowsDAOFactory extends AbstractMobileDeviceManagementDAOFactory
if (currentConnection.get() == null) {
Connection conn;
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();
currentConnection.set(conn);
} catch (SQLException e) {

Loading…
Cancel
Save