title: Out of container JNDI data source
body: <p>I would like to configure a DataSource using JNDI in a Java SE app. What is the best way to do this?</p>
  
  <p>So far, I've come across 2 projects:</p>
  
  <ol>
  <li><a href="http://directory.apache.org/subprojects/naming/using.html" rel="noreferrer">Apache Naming</a>. 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.</li>
  <li><a href="http://www.jboss.org/community/wiki/JBossNS" rel="noreferrer">JBossNS</a>. It looks like it's easy to configure a local-only JNDI using <code>LocalOnlyContextFactory</code>, but I haven't found any docs on how to actually configure a data source.</li>
  </ol>
  
  <p>If possible, I would like to also configure the data source with a JTA transaction manager (using JOTM?).</p>