private JDBCWithJNDIPersistenceHelper() {
super();
try {
InputStream inputStream = ClassLoaderUtils.getResourceAsStream(JDBCWithJNDIPersistenceHelper.PROPERTIES_FILE);
if (inputStream == null) {
throw new PersistenceException("File " + JDBCWithJNDIPersistenceHelper.PROPERTIES_FILE + " not found in classpath");
}
Properties properties = PropertiesReader.getPlainTextInstance().getProperties(inputStream);
String dataSource = properties.getProperty(JDBCWithJNDIPersistenceHelper.PROPERTY_DATASOURCE);
Context context = new InitialContext();
this.dataSource = (DataSource) context.lookup(dataSource);
} catch (Exception e) {
throw new PersistenceException(e);
}
}