Fast + Convenient Way To Create Glassfish v3/v2 Connection Pools / Data Sources
With Glassfish v2/v3 you can create a connection pool and data sources manually, by:
- Copying the JDBC-driver jar into [GLASSFISH_HOME]/domains/(domain1)/lib
- Setting up a connection pool and data source using the asadmin, web console, RESTful interface (v3) or editing the domain.xml file.
In Netbeans (6.7/6.8) the connection pools and datasources can directly deployed from the IDE. You can just "reuse" existing connection from the "services" tab, or create new one:
- Click on Databases -> Drivers and choose "New Driver".
- Point to an existing JDBC driver jar.
- Click on Databases -> New Connection and select your freshly created driver
After this step you will be able to connect the database, browse the tables and execute SQL-statements. Its convenient for development.
If you want to deploy a JDBC connection with your app, then:
- Click on your project (WAR, EJB) and choose New -> Other -> Glassfish -> Connection Pool
- Select your existing or freshly created connection - all the data will be extracted.
- Repeat Step 1. choosing a DataSource
- DataSource and ConnectionPools should appear in Tab "Services" -> Servers -> Glassfish -> Resources -> JDBC -> JDBC Resources
Gutentag Adam,
Please forgive me as I butcher the German. I've seen many, many examples of how to set these up, but there's hardly anything on how to reference them once they are. Can you please give me an example?
Danke!
Scott
Posted by Scott on January 15, 2010 at 02:16 AM CET #
THANK YOU!
Posted by Aaron on July 26, 2010 at 11:59 PM CEST #