How-to browse HE file database ?

93 views
Skip to first unread message

Xavier

unread,
May 22, 2011, 11:03:16 AM5/22/11
to play-framework
Hi all,

After a lot a months, I come back to my Play project. I have updated
to last version, and the default file database has changed to H2 :
great !

But, I don't know this engine. How can I browse the database content,
and how can I "put" some data from a SQL file (generated by
mysqldump) ?

Thanks,

Xavier

Pascal Voitot Dev

unread,
May 22, 2011, 11:23:42 AM5/22/11
to play-fr...@googlegroups.com
go to http://localhost:9000/@db

This is H2 console and there, you can see what's in your DB!

regards
Pascal


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


Xavier NOPRE

unread,
May 23, 2011, 7:20:59 AM5/23/11
to play-fr...@googlegroups.com
Hi,


> go to http://localhost:9000/@db
>
> This is H2 console and there, you can see what's in your DB!

Thanks ! But this console is very basic, all operations must be made
by SQL request, including browsing tables contents ...
Is there other solutions, more friendly ?
I tryied to use DbVisualizer, but impossible to connect to the H2 file
database : any idea ?

Thanks,

Xavier

Pascal Voitot Dev

unread,
May 23, 2011, 8:04:11 AM5/23/11
to play-fr...@googlegroups.com
Connect to H2 using MYSQL dialect because H2 is embedded in MYSQL mode in Play! so it mimics MYSQL

pascal
 

Xavier NOPRE

unread,
May 23, 2011, 10:20:53 AM5/23/11
to play-fr...@googlegroups.com
Hi,

> Connect to H2 using MYSQL dialect because H2 is embedded in MYSQL mode in
> Play! so it mimics MYSQL

In Dbvisualizer ? Which Databse driver will I choose ? "MuSQL" ? If
so, then, it want to connect to a TCP MySQL server (port 3306), but I
have only the H2 database file (on this machine).

Or do I have to initialy choose "JDBC/ODBC Bridge" for driver ? And
then, which "Database type", "Driver (JDBS)" and which format for URL
? "jdbc:h2:D:\Users\cc\myplay\db\h2\play;MODE=MYSQL" ?

Thanks,

Xavier

Pascal Voitot Dev

unread,
May 23, 2011, 10:28:15 AM5/23/11
to play-fr...@googlegroups.com

look at this thread
http://groups.google.com/group/h2-database/browse_thread/thread/689f69d5277ef5ab

it may help...
(I never tried to use dbvisualizer with H2 basically but I know play uses H2 in MySQL mode and I remembered this mail)

Pascal
 

GrailsDeveloper

unread,
May 23, 2011, 1:55:15 PM5/23/11
to play-framework
Or simple google h2 database and you will find http://www.h2database.com/html/main.html.
There is a good documentation over h2. h2 works perfectly together
with DBVisualizer at least with normal configuration, I don't tested
it with an play-db, but I can't see the difference.
Niels

On 23 Mai, 16:28, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:
> On Mon, May 23, 2011 at 4:20 PM, Xavier NOPRE <xno...@gmail.com> wrote:
> > Hi,
>
> > > Connect to H2 using MYSQL dialect because H2 is embedded in MYSQL mode in
> > > Play! so it mimics MYSQL
>
> > In Dbvisualizer ? Which Databse driver will I choose ? "MuSQL" ? If
> > so, then, it want to connect to a TCP MySQL server (port 3306), but I
> > have only the H2 database file (on this machine).
>
> > Or do I have to initialy choose "JDBC/ODBC Bridge" for driver ? And
> > then, which "Database type", "Driver (JDBS)" and which format for URL
> > ? "jdbc:h2:D:\Users\cc\myplay\db\h2\play;MODE=MYSQL" ?
>
> look at this threadhttp://groups.google.com/group/h2-database/browse_thread/thread/689f6...

Xavier NOPRE

unread,
May 23, 2011, 3:11:07 PM5/23/11
to play-fr...@googlegroups.com
Hi,

Thank you for your answer.

I had already done some research, before posting my question, but
nothing found to connect to a file database.

I have solved my problem adding a H2 JDBC driver in DbVisualizer,
pointing to the JAR file provided with Play, and then creating a DB
connection of type JDBC with H2 driver and URL like
"jdbc:h2:D:\Users\cc\myplay\db\h2\play".

Xavier

Reply all
Reply to author
Forward
0 new messages