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() { public WindowsTokenServiceImpl() {
windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl(); windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl();
WindowsDAOFactory windowsDAOFactory = new WindowsDAOFactory();
} }
@Override @Override

@ -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) {

Loading…
Cancel
Save