Results 1 to 6 of 6

Thread: How to configure hibernate?

  1. #1
    Join Date
    May 2009

    How to configure hibernate?

    Hello everybody, I am java programmer and i have came across hibernate now. Though i am beginner in this programming world. I want to use hibernate in my java project. I know little bit about this hibernate but still it would be helpful for me if somebody can tell me that how to configure hibernate.

  2. #2
    Join Date
    Apr 2008

    Hibernate is configured in two steps.

    Hibernate is the service which helps you to make difference between the front end and back end of your application. Basically hibernate is configured in two steps. First step is to configure the hibernate service. Configuring the hibernate service includes database connection parameters, collection of persistent classes and caching. And second step is to provide information about the classes to be persisted. These classes would be helping you to bridge gaps between the class and databases.

  3. #3
    Join Date
    May 2008

    Configure hibernate by or hibernate.cfg.xml

    If you want to configure the hibernate on your computer then you may do it by by using one of the configurations file provided by the hibernate. There are two configurations file in order to configure the hibernate, One is which is a standard java properties file and second is hibernate.cfg.xml. Both of these file performs the same functions. If you application classpath contains these both files then hibernate.cfg.xml overrides the settings found in the file.

  4. #4
    Join Date
    May 2008

    What hibernate.cfg.xml contains.

    Here is the code written in hibernate.cfg.xml file to configure the hibernate in a particular application.

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    <property name="connection.url">jdbc:derby://localhost:1527/SampleDB
    <property name="connection.username">root
    <property name="connection.driver_class">org.apache.derby.jdbc.ClientDriver
    <property name="dialect">org.hibernate.dialect.DerbyDialect
    <property name="connection.password">root
    <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory
    <property name="current_session_context_class">thread
    <property name="hibernate.show_sql">true

  5. #5
    Join Date
    Oct 2005

    Hibernate provided JDBC connections.

    If you are making an application with the hibernate provided JDBC connections then your hibernate configuration file must have the following properties.
    1. connection.driver_class which will be containing the JDBC connection class for the specific database.
    2. connection.url which represents full JDBC URL to the database.
    3. connection.username which will be used to connect to the database.
    4. connection.password to authenticate the username.
    5. dialect specifying the name of the SQL dialect for the database.

  6. #6
    Join Date
    Feb 2008

    Configuring hibernate by using XML file.

    You can configure the hibernate in your application by using XML files. This is the simplest and widely used approach. There are total two types of configuration that you can do using XML files. one is non-managed environment and another one is for managed environment. In managed environment, You can use source of database to establishing connection rather then specifying all the properties in the configuration file.

Similar Threads

  1. Computer Won't Hibernate
    By Kishan in forum Windows XP Support
    Replies: 3
    Last Post: 18-06-2010, 01:18 AM
  2. key combination to hibernate
    By Arlo1 in forum Windows XP Support
    Replies: 5
    Last Post: 13-01-2010, 06:25 AM
  3. XP Won't Wake Up from Hibernate
    By HaloFodder in forum Windows XP Support
    Replies: 1
    Last Post: 06-04-2009, 11:12 PM
  4. hibernate vs. sleep
    By cdsargent in forum Operating Systems
    Replies: 2
    Last Post: 21-11-2008, 10:35 AM
  5. Cannot hibernate
    By Pete in forum Vista Help
    Replies: 3
    Last Post: 07-06-2008, 04:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts