I would like to configure a DataSource using JNDI in a Java SE app. What is the best way to do this?
So far, I've come across 2 projects:
- Apache Naming. The project page has a specific example for configuring a data source, but it looks like the project is super old and no longer active.
- JBossNS. It looks like it's easy to configure a local-only JNDI using
LocalOnlyContextFactory
, but I haven't found any docs on how to actually configure a data source.
If possible, I would like to also configure the data source with a JTA transaction manager (using JOTM?).