Hi Pauluee,

The link you provided answers the NetBeans questions perfectly.
The message by Ewald on Mar 30 2009 explains how to load the H2 Driver
in NetBeans and connect to your database.
The very next message explains a quirk in NetBeans and an Embedded H2
connection (it doesn't get closed properly).

So,
1. Load the H2 driver in NetBeans (Go to Services Tab >> Databases >>
Right click Drivers and select New Driver)
2. Right click your newly created driver and select Connect Using.
Fill in your username, password and the URL. (if the OK button isn't
enabled, just select another field first and it will become enabled)


"But, in embedded mode the database structures and data don't exist
untiil runtime. "
This isn't correct.  If the Database doesn't exist, an empty one will
be created for you (regardless of wheather it's an embedded or tcp
connection).  You can now use SQL statements from within NetBeans to
create tables, do queries etc. by right clicking on
Databases >> YourDBNode >> PUBLIC >> Tables and selecting Execute
Command, or just select Create Table to create it graphically.


If your URL is for a local connection, remember that you can't connect
to the same database from another process concurrently.
Since NetBeans doesn't close the local connection properly, you won't
be able to connect from an application you write within NetBeans if
you already made a connection to it from the Services Tab.  This
connection only really gets closed if you close NetBeans.

A good option is to start the H2 server first by double clicking the
h2.jar file and connect to it using a tcp connection (jdbc:h2:tcp://
localhost//the/path/to/the/db).  This way you can have a connection
open in NetBeans, as well as run an app you wrote that connects to the
same db.
When your app is finished, change the url in the application to
embedded mode and test it again.

Hope this helps
-- 
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