ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Hibernate for Java SE
Subject:   still use Spring & JNDI
Date:   2005-11-17 14:00:29
From:   brondsem
I do something similar, but continue to use Spring (it wires nearly everything together, so I must, and it's good to use) and JNDI to get a handle for my datasource. No changes to my code. IIRC, all I had to do was change my spring applicationContext.xml to use "classpath:hibernate.cfg.xml" as the value of "configLocation" (on my org.springframework.orm.hibernate3.LocalSessionFactoryBean), put the same hibernate.cfg.xml file on my classpath when running my j2se code, and provide the JNDI environment and datasource with simple-jndi (from http://www.osjava.org/simple-jndi/) instead of Tomcat. I'd be happy to provide more details if anyone wants; configuring simple-jndi took me a little while.

1 to 1 of 1
  1. still use Spring & JNDI
    2005-11-17 16:44:54  Jason-Lee [View]

    • still use Spring & JNDI
      2005-11-18 07:09:31  brondsem [View]

1 to 1 of 1