0

Can I capture exceptions from resources looked up via @Resource? In the example below, a resource is being looked up via JNDI. There may not be a JNDI when running the app locally so I want to add an exception handler to capture this & create the data source another way.

@Resource(lookup="jdbc/ds_demo",
        description="Primary DataSource", 
        authenticationType=AuthenticationType.CONTAINER, 
        shareable=false,
        mappedName="ds_demo")
private DataSource primaryDataSource;
Mr Smith
  • 3,318
  • 9
  • 47
  • 85

0 Answers0