Home > hibernate_exercise_solution_app

hibernate_exercise_solution_app

Hibernate_exercise_solution_app is a project mainly written in Java, it's free.

Please have your computer set up as follows. Note that there are a few elements that you have to pull together to have your system ready to go, so just make sure that you follow each item carefully. If anything isn't clear let me know as soon as possible.

  1. Download the code git clone git://github.com/dlbock/hibernate_exercise_solution_app.git

  2. Create a new IntelliJ project and import the existing *.iml module file.

  3. Download HSQLDB version 2.2.4 to somewhere you can get to easily http://sourceforge.net/projects/hsqldb/files/hsqldb/hsqldb_2_2/hsqldb-2.2.4.zip/download

Read up on HSQLDB to familiarize yourself with what it is.

  1. Set up your local database. There are 2 things you need to run to get the database up and running: a. First you need to start your database server. In the directory that HSQLDB lives, Mac/Linux users: java -classpath lib/hsqldb.jar org.hsqldb.server.Server

Windows users, run the bin/runServer.bat file.

b. HSQLDB comes with a Java Swing interface for you to type SQL scripts in (i.e. create tables, drop tables, etc), to start that up,

Mac/Linux users: java -classpath lib/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing

Windows users, run bin/runManagerSwing.bat.

To get into the database to be able to type out your SQL scripts, use: jdbc:hsqldb:hsql://localhost for the URL then hit OK.

Now you can start writing SQL to create tables. So type the following: CREATE TABLE cars (id identity, name varchar(50), numberPlate varchar(50));

CREATE TABLE contacts (id identity, firstName varchar(50), lastName varchar(50));

  1. Run the CarRepositoryIntegrationTest and the ContactRepositoryIntegrationTest and make sure that they both pass.
Previous:Give-This-a-Try