HSQLDB connection with tomcat 9 servlet

2020-05-18 java tomcat servlets hsqldb

I'm new at servlets and hsqldb connection for java web. I'm trying to test if the hsqldb is connecting with my app with a servlet but I can't figure out how I can do that. I already put hsqldb jar inside WEB-INF/lib and configured both context.xml on tomcat and web.xml. Please help.

Here's context.xml

 <Resource name="jdbc/javausecasedb" auth="Container" type="javax.sql.DataSource" 
maxTotal="50" maxIdle="30" maxWaitMillis="10000" 
username="SA" password="" 
driverClassName="org.hsqldb.jdbc.JDBCDriver" 
url="jdbc:hsqldb:hsql://Users//nayanaciuro//Desktop//Database//LoginExercise"/>

Here's web.xml:

<resource-ref>
<description>HSQL Datasource example</description>
<res-ref-name>jdbc/javausecasedb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-

Answers

Related