Watching content of embedded H2 in browser

109 views
Skip to first unread message

diepulle

unread,
Mar 11, 2010, 1:33:42 AM3/11/10
to H2 Database
Hi,

I´ve the following problem. I use the H2-db in embedded mode in an
j2ee-application. The directory, where the scheme is located is: /usr/
local/jboss/
In this directory there´s stored a try.h2.db and a try.lock.db

My problem now is, that I wanted to watch the content of this db in
the browser-tool.
So I started H2 in server-mode allowing remote connections with the
following command java -cp h2*.jar org.h2.tools.Server -webAllowOthers

Now I tried to connect remotely connect to this h2-server using the
following url https://myip:8082
This works also, but when I try to connect by browser with the
following jdbc-url jdbc:h2:tcp://localhost/usr/local/jboss/try I don
´t see the tables located in this scheme.

What´s my error? Why I can´t see the tables located in the scheme,
although they´re there?

Thanks.

Erin Drummond

unread,
Mar 11, 2010, 4:19:13 AM3/11/10
to h2-da...@googlegroups.com
You dont need tcp://, just specify the local path, eg:
jdbc:h2:/usr/local/jboss/try

What you did probably caused the creation of a new database, which is
why it was blank. You can use the option IFEXISTS=TRUE to protect
against that.

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

diepulle

unread,
Mar 11, 2010, 5:46:38 PM3/11/10
to H2 Database
Hi Erin,

your tip was quite good. It solved my problem completly.

Thanks again.

On 11 Mrz., 10:19, Erin Drummond <erin....@gmail.com> wrote:
> You dont need tcp://, just specify the local path, eg:
> jdbc:h2:/usr/local/jboss/try
>
> What you did probably caused the creation of a new database, which is
> why it was blank. You can use the option IFEXISTS=TRUE to protect
> against that.
>

> On Thu, Mar 11, 2010 at 7:33 PM, diepulle <diepu...@googlemail.com> wrote:
> > Hi,
>
> > I´ve the following problem. I use the H2-db in embedded mode in an
> > j2ee-application. The directory, where the scheme is located is: /usr/
> > local/jboss/
> > In this directory there´s stored a try.h2.db and a try.lock.db
>
> > My problem now is, that I wanted to watch the content of this db in
> > the browser-tool.
> > So I started H2 in server-mode allowing remote connections with the
> > following command java -cp h2*.jar org.h2.tools.Server -webAllowOthers
>
> > Now I tried to connect remotely connect to this h2-server using the

> > following urlhttps://myip:8082

Thomas Mueller

unread,
Mar 13, 2010, 5:47:09 AM3/13/10
to h2-da...@googlegroups.com
Hi,

> The directory, where the scheme is located is: /usr/local/jboss/

> jdbc:h2:tcp://localhost/usr/local/jboss/try

This points to <currentWorkingDirectory>/usr/local/jboss/try. You need
to add one more backslash:

jdbc:h2:tcp://localhost//usr/local/jboss/try
or (a bit clearer):
jdbc:h2:tcp://localhost/file:/usr/local/jboss/try

See also http://www.h2database.com/html/cheatSheet.html

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages