Java Reference
In-Depth Information
4.
Create a file called
hibernate.cfg.xml
with the following content:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">
<property name="hibernate.connection.username">
root</property>
<property name="hibernate.connection.password">
mypassword123</property>
<property name="hibernate.connection.pool_size">
10</property>
<property name="show_sql">true</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.current_session_context_class">
thread</property>
<mapping class="Employee" />
</session-factory>
</hibernate-configuration>
5.
Add the file to the
src
directory of your project. Your Eclipse environment now looks like
Figure 9-14.
figure 9-14
Search WWH ::
Custom Search