I am having some trouble connecting to my H2 database - below is the block of code I wrote to establish the connection:
Class.forName("org.h2.Driver").newInstance(); Server server = Server.createTcpServer().start(); Connection conn = DriverManager.getConnection("jdbc:h2:tcp://localhost/schedules", "sa", "");
The Driver class, JDBC URL, User Name and Password I used in the code above is exactly the same to what I'm using to connect to my database in the H2 login page. The URL of my database login page is http://localhost:8082. 8082 is the port I'm using that's tunneled via SSH to my actual database that's hosted in a separate server. When I tried to query the database by executing
Statement stmt = conn.createStatement(); rs = stmt.executeQuery("select * from Schedules");
I got the following error in the console: org.h2.jdbc.JdbcSQLException: Table "Schedules" not found; SQL statement: select * from Schedules [42102-126]
When I changed the table name to one that doesn't even exist in my database I got the same error message. Does anyone know what I've done wrong? Your help would be tremendously appreciated!