Did you create the database in embedded mode ahead of time?  If so, it
may be that you have to use the full file path when using TCP vs.
embedded mode.  So you're possibly creating a database with the same
name in a different folder with the tcp URL.

There's more detail in the URL section of the Features page of the
documentation:
http://www.h2database.com/html/features.html#database_url


On Feb 24, 7:44 pm, Liz <[email protected]> wrote:
> Hello,
>
> 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 
> ishttp://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!
>
> Cheers,
> Liz

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to