Thursday Mar 20, 2008

Create MySQL jdbc Connection Pool from Glassfish Admin GUI




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




About

davisn

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today