It maybe because you may need to create Db Resource
and Pool
manually on the Glassfish server like this,
In Netbeans -> Projects, Open Server Resources -> glassfish-resources.xml
We have to create JDBC Resource and JDBC Connection Pool Manually on Glassfish. I am using my values here, don't use them, see your .xml !
Value of jndi-name
is your JDBC Resource and Value of pool-name
is your JDBC Connection Pool.
Open Browser for Glassfish Admin,
https://localhost:4848/
Go to JDBC Connection Pool -> New:
1) Pool Name: mysql_customersdb_rootPool
2) Resource Type: javax.sql.ConnectionPoolDataSource
3) Database Driver Vendor: MySql
Press Next
URL: jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull
Url: jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull
User: root
Password: root
JDBC Resources -> New
JNDI Name: CustomersDS
Pool Name: mysql_customersdb_rootPool
Press Ok.
Right Click your Project and Press Run :)