To create a mySQL dbc connection pool from Glassfish V2 Admin GUI console, please follow 2 steps below
1. Create a new mysql test account
2. Create jdbc connection pool
1. Create a new mysql user account
a. Start database from a command prompt
$../<GlassFish-Installed>/mysql/bin/mysqld-nt.exe --defaults-file=../<GlassFish-Installed>/mysql/mysql.ini
(For Solaris machine replace mysqld-nt.exe by mysqld_safe)
b. Login as database admin to create a testUser account
$../<GlassFish-Installed>/mysql/bin/mysql -u root
mysql> grant all privileges on *.* to 'testUser'@'localhost' identified by 'testPassword';
2. Create jdbc connection pool and test the connection
a. Start domain1
../<GlassFish-Installed>bin/asadmin start-domain
b. Create jdbc connection pool for mySQL
-From Admin GUI Console > expand Resources node > JDBC > Connection Pools > click New button and enter information below:
Name: testMYSQL
Resources Type: javax.sql.DataSource
Database Vendor: MySQL
Click Next to proceed to the next panel
Go to Additional Properties and enter:
databaseName: test
User: testUser
Password: testPassword
ServerName: localhost
Click Finish button
Click testMYSQL > select ping to test the connection

I am having problems connecting to mySQL with Glassfish server. I did the suggestion on this web site (Create MySQL jdbc Connection Pool from Glassfish Admin GUI). the Ping was successful.
I downloaded the jdbc driver but i'm not sure which files to copy to the glassfish directory. I'm receiving error (Error trying to fetch data UserID/Password java.sql.SQLException)
Posted by Brenda on May 13, 2008 at 01:23 PM PDT #
Hi Brenda,
The file you need to download to glassfish/lib directory is "mysql-connector-java-5.1.6-bin.jar" from the url http://dev.mysql.com/downloads/connector/j/5.1.html.
Please let me know if it's working out for you.
-davis
Posted by Davis Nguyen on May 14, 2008 at 03:07 PM PDT #
Sorry, the url should be http://dev.mysql.com/downloads/connector/j/5.1.html (no . at the end)
Posted by Davis Nguyen on May 15, 2008 at 10:00 PM PDT #