Connect to the Demo Database Externally
There are many database clients that allow you to connect to databases and manage data. We recommend using the free SQL Client DBeaver. DBeaver is a cross platform database client based on eclipse that uses JDBC to connect to databases, which allows you to connect to multiple different databases and manage all of them in the same client.
DBeaver
If you followed the setup steps in Running Locally, you should have a HSQL database running locally that you can connect to with DBeaver. If you don't have it already, Download DBeaver (http://dbeaver.jkiss.org/download/) and install it.
- Open DBeaver and click the new button to create a new Connection
- Select HSQLDB Server as the type of Connection
- Fill in the Connection settings with the default properties broadleaf uses for HSQLDB
- Click the test connection button. You will be prompted to download the JDBC driver for HSQLDB, go ahead and click the download button.
- After the JDBC driver is downloaded, dbeaver will test the connection, and you should receive a success notification. Click next through the rest of the prompts until you reach the last one. There you can name the connection whatever you like and click finish.
Now you have successfully setup a new connection to your DemoSite HSQL Database. You can now browse through the schema and tables with the Database Navigator, or start a new SQL script by pressing F3.
IntelliJ
When doing development, it is useful to connect to the database to either view or manipulate its contents. By default, an HSQL database is started up for the community starter to utilize. You can connect to this database from within IntelliJ with the following steps.
Click the Database button at the top right of the IntelliJ window. Alternatively, from the toolbar you can click View -> Tool Windows -> Database.
Click the + button -> Data Source -> HSQLDB (Remote).
Set the Database field to
broadleaf
.Set the User field to
sa
.Leave the Password field blank.
- If you've never used IntelliJ to connect to a remote HSQLDB before, then you must click Download towards the bottom of the window to get the proper driver.
- You should now be able to click Test Connection and see Successful.
Click OK.
IntelliJ will index the contents of the database, which could take a moment. Once this is complete, you should see all of the tables in the database pane now.
- You can now double click a table to view and manipulate the contents.
- You can also click the Open Console button on the toolbar in the top of the database pane to write raw SQL against the database.
That's it! You now have control over the default HSQL development database.
HSQL is great for development and getting started quickly, however it has poor performance and isn't suitable for production applications. When you are ready to move to a more production-ready database, see Database Configuration for instructions on how to configure your project to connect to MySQL, MS SQL, Oracle, or PostgreSQL.