How do I lookup a JNDI Datasource from outside a web container?

后端 未结 5 1175
半阙折子戏
半阙折子戏 2020-12-23 10:47

I have the following environment set up:

  • Java 1.5
  • Sun Application Server 8.2
  • Oracle 10 XE
  • Struts 2
  • Hibernate

5条回答
  •  余生分开走
    2020-12-23 11:13

    I got stuck on this exact same problem. I wrote a small tutorial. Basically you have to create your own implementation of the DataSource objects and add them to your own custom initial context. There are source examples here:

    Running Beans Locally that use Application Server Data Sources

提交回复
热议问题