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:
Full details for creating MySQL connection pool in Glassfish can be found from the link below:
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) )