Creating the Database

Log into MySQL and execute the following DDL statements to create the database and tables for the tutorial.

create database languages;

Configuring the JDBC Driver

Once the database is created, edit the region marked with

<!-- Uncomment and update JDBC driver dependency. -->

in your project's pom.xml to add dependency to the MySQL JDBC driver as shown below.

<!-- Uncomment and update JDBC driver dependency. -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.10</version>
</dependency>

Importing into Eclipse

At this point you'd want to import the project into Eclipse as described in the Getting Started section.

Configuring Hibernate

Edit src/main/resources/hibernate.cfg.xml as shown below to add the JDBC connection details.

<session-factory>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost/languages</property>
    <property name="hibernate.connection.username">user_name</property>
    <property name="hibernate.connection.password">password</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>

    <property name="hibernate.hbm2ddl.auto">update</property>
</session-factory>