I use jstl tag library to connect at H2 database at a jsp file.
I want to find the path of the database dynamically (or to be related, not absolute path).
I write this
Code:
<sql:setDataSource url="jdbc:h2:"+context.getRealPath("/DB/db")+"""
driver="org.h2.Driver"
user="SA" password=""/>
but there is an error.
How can I make the setdatasource to have a related file?
I tried this also
Code:
<sql:setDataSource url="jdbc:h2:/DB/db"
driver="org.h2.Driver"
user="SA" password=""/>
and it did not work.
The relative path of the db is DB (folder) / db (database).