There is a local application that I use for testing purposes. It is running on an tomcat server that is executed via IntelliJ IDEA. Now I want to build an API that I can send a HTTP-Request to (something like http://%myAddress%:8123/rate) and then a new database entry is created. For the database I would like to use h2 database engine.
I have done some research on how to use h2 and found this post.
Now I tried to import that module. Since this is a maven application, I added a new dependency:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
</dependency>
And then I created a new class where I want to initialize the Database structure:
package mypackage;
import org.h2.jdbcx.JdbcDataSource;
public class DataBaseInitializer {
public DataBaseInitializer() {
}
}
Sadly the import is failing, since he Cannot resolve symbol 'h2'
.
What did I do wrong?