Cannot connect to database using JDBC on Glassfish3 Cannot connect to database using JDBC on Glassfish3 oracle oracle

Cannot connect to database using JDBC on Glassfish3


Copy all required jar files(ojdbc6.jar.....) to 'domains\domain1\lib\ext' folder. Then restart your glassfish.Then try to ping from glassfish, it will work


"..But how do you know it is 'ext' folder? And not just 'lib'? One guy says lib, other ext.."

Making the JDBC Driver JAR Files Accessible To integrate the JDBC driver into a GlassFish Server domain, copy the JAR files into the domain-dir/lib directory, then restart the server. This makes classes accessible to all applications or modules deployed on servers that share the same configuration. For more information about GlassFish Server class loaders, see "Class Loaders" in GlassFish Server Open Source Edition Application Development Guide. If you are using an Oracle database with EclipseLink extensions, copy the JAR files into the domain-dir/lib/ext directory, then restart the server. For details, see "Oracle Database Enhancements" in GlassFish Server Open Source Edition Application Development Guide

From here


Note that when NetBeans runs glassfish on Windows, the "domains" directory it uses is in your home directory, not in C:\glassfish or C:\Program Files\glassfish

On my windows 7, running NetBeans 8.0.2 with Glassfish 4.1, I had to put the Oracle driver jar (ojdbc6.jar) into

c:/Users/t823517/AppData/Roaming/NetBeans/8.0.2/config/GF_4.1/domain1