刚才又看了一下Hibernate的QuickStart,里面有这样一段话:
A SessionFactory is Hibernate's concept of a single datastore, multiple databases can be used by creating multiple XML configuration files and creating multiple Configuration and SessionFactory objects in your application.
Put all Hibernate libraries in tomcat/common/lib
This class use a new property "api.server.home" which must contain the API server home. Thus add =-Dapi.server.home="%CATALINA_HOME%"=in the file catalina.bat (or cataline.sh).
Put hibernate.cfg.xml in tomcat/conf.
Put all mappings and JAVA BEANs and the factory JndiSessionFactoryImpl.class in tomcat/common/classes
Finally, modify tomcat/conf/server.xml