Connect to HSQLDB database via JDBC running on Apache Tomcat

2020-05-01 jsp jdbc hsqldb

I have spent the last few hours on this and it feels like I've come a long way (for me)

  1. Set up Apache Tomcat on Mac [Success]
  2. Start Apache Tomcat ./bin/startup.sh [Success]
  3. Make project file in webapps inside Tomcat and out.print() value with index.jsp page [Success]
  4. Install HSQLDB on Mac with a Brew Tap [Success]
  5. Run hsqldb.java and use Database Manager to make database [Success]
  6. Create table with test data using SQL commands in HSQLDB Database Manager [Success]
  7. Use Select query to return rows [Success]

Basically now, if I was in PHP working with a MySQL database I would use the mysql connect function. But.. I'm working with JSP (Inside Apache Tomcat) attempting to connect to a HSQLDB. I have no idea what I'm doing. Apparently I need to use the JDBC API (I know this much), but I'm not sure whether I have everything I need. Do I already possess the correct Java file for the task (hsqldb.java)? Or do I need something else.

I really don't know where to start. I just want to Connect to the new Database (running on HSQLDB) and Run the select query from a JSP page.

Answers

Related