Hi,
First, there are a Netbeans plugin to integrate H2 into databases tab of
netbeans named: "H2 Database Engine Support" , search in netbeans site.
You can start and H2 engine to use it via tcp connection.

For embeded usage In Services tab -> Drivers node , you can add H2 jdbc
driver ;
and then create a new embedded connection with this driver.
Then you can use all database and persistence features of netbeans over
your embeded H2 database.
Remember that this connection open your H2 database. embeded in Netbeans !
So if you run you webapp from the ide or any other place , you must to
close this connection before (only one embedded connection at the same
time).

> It's really probably more of a netbeans problem.  I am having trouble
> getting my application to use the version of the h2 library that I
> have placed in my WEB_INF/lib folder and it insists on using the one
> residing in my local file system, hence the little test databases all
> over my computer.  

Define a new library for H2 driver in netbeans: Tools -> Libraries
then add this library to your project.

> For the purposes of my web app I have not yet
> figured out the secret handshake to get my code to run in the context
> of my web app's directory structure, nor have I been able to get
> netbeans to successfully deploy the app directly to glassfish from the
> IDE as per the directions in netbeans help files.  I can only assume
> that I'm missing something somewhere and in time I will find it.
>   

Don't create a WEB-INF/lib dir for your self this confuse netbeans
webapp deploy.
Or deploy your self outside the ide , but don't mix both methods.

To use JNDI Datasources in GlassFish you can need to open admin console:

1. From Common Task menu expand Resources menu by clicking on Resources
menu.
2. Expand JDBC under resources.
3. Click on ‘Connection Pools’ under JDBC menu. The Connection Pools
page will be displayed.
4. Click on New.
5. Enter a name for your JDBC Connection pool. Select java.sql.Driver as
your ‘Resource Type’ and type (not select) "H2 Database" as your
‘Database vendor’.
6. Next button , and then type "org.h2.Driver" in controller field
(leave other values as is)
7. Fill connection parameers (URL, User, Passw) with your own values
(url for embed is like ; jdbc:h2:~/grassfish-db/mydb )
9. Finish button
10. Then you can create your JNDI name to reference h2 connection pool
in "JDBC Resources" menu.


regards
Dario.

-- 
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