| 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. | ||
Showing messages 1 through 1 of 1.
-
still use Spring & JNDI
2005-11-17 16:44:54 Jason-Lee [View]



Thanks.