Create Oracle DataSource in Glassfish

1 . Copy JDBC Oracle driver to GLASSFISH/lib, for example, copy ojdbc14.jar to /usr/local/glassfish/lib.

2. Restart Glassfish, log on to Glassfish admin interface, create a new JDBC Connection Pool.
Delete all properties, and add following properties:
user – set this to Oracle userid
password – set this to Oracle password
URL – set this to the URL, Format : jdbc:oracle:thin:@HOSTNAME:PORT:SID.

Test the connection pool by clicking the “ping” button to get the verify  message.

3. Create a JDBC DataSource using the JDBC Connection Pool.

Full details for creating an Oracle connection pool in Glassfish2.1.1 can be found from the link below:

http://mariosgaee.blogspot.com/2009/12/oracle-connection-pool-in-glassfish.html

Full details for creating MySQL connection pool in Glassfish can be found from the link below:

http://www.albeesonline.com/blog/2008/08/06/creating-and-configuring-a-mysql-datasource-in-glassfish-application-server/

One comment

  1. Ahmad Shakil

    You can add JDBC URL like below

    jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ecompt-sc.kw.zain.com)(PORT = 1506)) ) (CONNECT_DATA = (SERVICE_NAME = ECOMP) )
    )

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s