Hibernate Hosting

Hibernate is an object relational mapping (ORM) tool for Java. It maps objects to an underling database creating a persistance layer.

Hibernate is supported by all of our Java Web Hosting plans. That said, Hibernate uses cache so an allowance should be made when calculating resources needed.

To deploy Hibernate on your Java Web Hosting Tomcat:

  1. Place the hibernate3.jar and all related libraries into the WEB-INF/lib directory of your webapp.
  2. Create either a hibernate.cfg.xml or a hibernate.properties file and place it into WEB-INF/classes.
  3. Build a SessionFactory as shown here
  4. Build a listener:

    public class HibernateListener implements ServletContextListener {

       public void contextInitialized(ServletContextEvent event) {
          HibernateUtil.getSessionFactory(); // Just call the static initializer of that class
       }

       public void contextDestroyed(ServletContextEvent event) {
           HibernateUtil.getSessionFactory().close(); // Free all resources
       }
    }

  5. Add the listener to your web.xml .
If you are an existing customer needing assistance with Hibernate, please contact tech support. If you are a prospective customer, please visit our Java Web Hosting home page for more information on our hosting plans.

For more details on configuring Hibernate on Tomcat, including a sample hibernate.cfg.xml file, visit the Tomcat page on Hibernate.org.

 
 
Live Chat Live Help Software for Website
 
Java Web Hosting supports all Java libraries and frameworks including: If it's Java it will run on Java Web Hosting.
 
Bookmark Java Web Hosting

Copyright © 2001 - 2010 All rights reserved
Strategic Services Group, Inc. - 34 E. Germantown Pike #240 - Norristown, PA, 19401 - USA
(215) 654-8150 - Toll Free from the US & Canada (800) 450-2750