Exercise 8.1 – Setting Up the Database
To set up the database to use for SQLXML exercises.
- Start H2
- The H2 database will be used for these exercises. It is a free, lightweight database, and its also bundled with the eiConsole
- To use the bundled H2, the eiConsole must be running. The bundled H2 instance will shut down when the eiConsole does.
- From the File Management screen, open the Tools menu and click “H2 Database…”.
- A dialog will appear called “H2 Database Manager”. It will say whether or not the H2 Database is currently running.
- To start or stop the H2 database, use the “Start the Database” or “Stop the Database” buttons in this dialog. “Return to Console” closes the dialog but leaves the H2 state unchanged.
- Once the H2 database is started a web browser window with the H2 login screen should appear.
- Sign Into Database
- The H2 Login Screen may look slightly different than the screenshot, depending on what the default settings are.
- Don’t change the JDBC URL, unless you are an experienced H2 user, and put in “eip” as both the User Name and Password.
- Remember or write down the JDBC URL. It will be important in the following exercises.
- Click “Connect” to log in.
- Create People Table
- Locate the sample file create_people.sql.
- Open it and copy its contents into the main text box in the H2 browser application.
- Execute the SQL query. If done correctly, there should now be a PEOPLE item in the left hand panel, and a success message below the text field.
- The People table now exists in the database.
- Exit the H2 Console
- In the top left corner of the screen, there is a button shaped like the letter “N”.
- Click it to close the console and log out.
- IMPORTANT: Make sure you always log out of the H2 console before attempting to run a Route from a database exercise. Otherwise, being logged into H2 may prevent another connection from being made.