Glassfish does not ship with oracle jdbc drivers. The oracle driver needs to be added manually. The driver can be found either in a JDeveloper or oracle client or database installation in {install_path}/jdbc/lib, or from oracle's site:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
Glassfish needs at least ojdbc14.jar to work properly. Older drivers do not work. Put the ojdbc14.jar in {glassfish}/lib directory and restart glassfish:
asadmin stop-domain domain1
asadmin start-domain domain1
Now you need to navigate to the administrator application:
http://localhost:4848/
Open the 'Resources' -> 'JDBC' -> 'Connection Pools' and select 'New.
Fill in the Connection Pool 'Name'.
Select 'Resource Type' : 'javax.sql.ConnectionPoolDataSource'.
Select 'Database Vendor' : 'Oracle'.
Select 'Next'.
At the next page go down at the additional Properties.
Select all the properties and select 'Delete Properties'.
Select 'Add Property', fill 'Name' : 'user' and 'Value' : {db_user}
Select 'Add Property', fill 'Name' : 'password' and 'Value' : {db_user_pass}
Select 'Add Property', fill 'Name' : 'url' and 'Value' :
jdbc:oracle:thin:@[host][:port]:SID
or
jdbc:oracle:thin:@//[host][:port]/SID
Select 'Finish'.
Navigate to Connection Pools and select the pool you just created.
Click Ping to test that it is working. If it is not, it is probably because you have mistyped the connection credentials. Go to 'Additional Properties' tab of the connection pool detail page and correct any errors. Try ping again.
Open the 'Resources' -> 'JDBC' -> 'JDBC Resources' and select 'New.
Fill the JNDI Name like 'jdbc/myconnnection'.
Select from 'Pool Name' combo box the pool we already created.
And select 'OK'.
The Connection Pool is ready!
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
Glassfish needs at least ojdbc14.jar to work properly. Older drivers do not work. Put the ojdbc14.jar in {glassfish}/lib directory and restart glassfish:
asadmin stop-domain domain1
asadmin start-domain domain1
Now you need to navigate to the administrator application:
http://localhost:4848/
Open the 'Resources' -> 'JDBC' -> 'Connection Pools' and select 'New.
Fill in the Connection Pool 'Name'.
Select 'Resource Type' : 'javax.sql.ConnectionPoolDataSource'.
Select 'Database Vendor' : 'Oracle'.
Select 'Next'.
At the next page go down at the additional Properties.
Select all the properties and select 'Delete Properties'.
Select 'Add Property', fill 'Name' : 'user' and 'Value' : {db_user}
Select 'Add Property', fill 'Name' : 'password' and 'Value' : {db_user_pass}
Select 'Add Property', fill 'Name' : 'url' and 'Value' :
jdbc:oracle:thin:@[host][:port]:SID
or
jdbc:oracle:thin:@//[host][:port]/SID
Select 'Finish'.
Navigate to Connection Pools and select the pool you just created.
Click Ping to test that it is working. If it is not, it is probably because you have mistyped the connection credentials. Go to 'Additional Properties' tab of the connection pool detail page and correct any errors. Try ping again.
Open the 'Resources' -> 'JDBC' -> 'JDBC Resources' and select 'New.
Fill the JNDI Name like 'jdbc/myconnnection'.
Select from 'Pool Name' combo box the pool we already created.
And select 'OK'.
The Connection Pool is ready!