SlideShare a Scribd company logo
2
Most read
JNDI Data source Setup in Glassfish Server
JNDI Data source Setup in Glassfish Server
1. Before you start JNDI setup, Create database in Mysql Server
Example: my database name is nvPortal.
2. Download MySql connector jar file. Exp: mysql-connector-java-5.1.18-bin.jar
3. Copy mysql-connector jar file into your local glassfish server domains lib folder location
example : C:glassfish4glassfishdomainsdomain1lib
4. Restart the glassfish server.
5. Open glassfish Server Administrator consol
Go to ----> Resources -----> JDBC ----- > JDBC Connection Pools
6. Create New JDBC Connection Pool
---- > Click new button to displays following window
Enter Connection Pool details:
Pool Name: nvPool
Resource Type: select javax.sql.Datasorce from dropdown list.
Database Diver Vendor: select diver vendor MySql from dropdown list.
Sumanbehara1@gmail.com
JNDI Data source Setup in Glassfish Server
7. click next to shows the following window:
a. You can change default Pool settings as per your requirement shows in
below window. Like Initial and Minimum Pool Size, Maximum Pool Size, Pool
Resize Quantity, Idle Timeout, Max Wait Time.
b. Enter Your Local MySql database connection details:
User: root
Password: root
Database Name: nvPortal
Url: jdbc:mysql://localhost:3306/nvPortal
sumanbehara1@gmail.com
JNDI Data source Setup in Glassfish Server
8. Click finish to create nv Connection Pool. nvPool shows in connection pool list
9. Click on nvPool to displays the below window -----> Click on --- > Ping button.
a. If database connection details are correct, message displays Ping Succeeded.
Your Connection pool is created successfully. It shows following window.
sumanbehara1@gmail.com
JNDI Data source Setup in Glassfish Server
b. If database connection details are not correct, message displays An error has
occurred. It shows the following error window. Check your User Name,
Password, database Name and Connection URL.
10. Create JDBC Resources.
a. Go to ----> Resources -----> JDBC ----- >JDBC Resources
b. Click to New button to displays following window
sumanbehara1@gmail.com
JNDI Data source Setup in Glassfish Server
Enter JDBC resource Details:
JNDI Name: jdbc/nvPortal
Pool Name: Select nvPool from drop down list.
Click Ok to create JDBC Resources successfully. Jdbc/nvPortal shows
in JDBC resources.
sumanbehara1@gmail.com
JNDI Data source Setup in Glassfish Server
*** Note: Jdbc/nvPortal name and in your spring application ----> /WEB-INF/etc/conf/jndi-dao-
nvPortal-config.xml file contains JNDI name should be same.
Example: in jndi-dao-nvPortal-config.xml
<jee:jndi-lookup id="portalJNDI" jndi-name="jdbc/nvPortal"/>
sumanbehara1@gmail.com

More Related Content

PPTX
Python selenium
PDF
Nvo objects powerbuilder
PPT
Advanced Load Runner
PDF
Web Worker, Service Worker and Worklets
PPT
Asynchronous Programming in C# - Part 1
PDF
Crud tutorial en
PPTX
Handling I/O in Java
PPT
06 abstract-classes
Python selenium
Nvo objects powerbuilder
Advanced Load Runner
Web Worker, Service Worker and Worklets
Asynchronous Programming in C# - Part 1
Crud tutorial en
Handling I/O in Java
06 abstract-classes

What's hot (6)

PPTX
Http session (Java)
PDF
software engineer interview questions.pdf
PDF
Html básico 4 tabelas
PPTX
Asp.net web api
PPT
Menu bars and menus
PPTX
Advance Java Topics (J2EE)
Http session (Java)
software engineer interview questions.pdf
Html básico 4 tabelas
Asp.net web api
Menu bars and menus
Advance Java Topics (J2EE)
Ad

Similar to JNDI Data source Setup in Glassfish Server (11)

PPTX
Cejv659 week09 glassfish-s14
PDF
Connect2014 Show104: Practical Java
PPTX
Spring database - part2
PDF
GlassFish REST Administration Backend at JavaOne India 2012
PDF
GlassFish REST Administration Backend
PPT
SHOW104: Practical Java
PDF
Java Web Programming [3/9] : Servlet Advanced
PDF
PDF
Java Web Programming Using Cloud Platform: Module 3
PDF
Weblogic configuration
PDF
Weblogic Cluster configuration
Cejv659 week09 glassfish-s14
Connect2014 Show104: Practical Java
Spring database - part2
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend
SHOW104: Practical Java
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming Using Cloud Platform: Module 3
Weblogic configuration
Weblogic Cluster configuration
Ad

Recently uploaded (20)

PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Cell Structure & Organelles in detailed.
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
master seminar digital applications in india
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Cell Structure & Organelles in detailed.
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
master seminar digital applications in india
Microbial disease of the cardiovascular and lymphatic systems
GDM (1) (1).pptx small presentation for students
Microbial diseases, their pathogenesis and prophylaxis
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharma ospi slides which help in ospi learning
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
O7-L3 Supply Chain Operations - ICLT Program
Abdominal Access Techniques with Prof. Dr. R K Mishra
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
A systematic review of self-coping strategies used by university students to ...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
102 student loan defaulters named and shamed – Is someone you know on the list?
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf

JNDI Data source Setup in Glassfish Server

  • 1. JNDI Data source Setup in Glassfish Server JNDI Data source Setup in Glassfish Server 1. Before you start JNDI setup, Create database in Mysql Server Example: my database name is nvPortal. 2. Download MySql connector jar file. Exp: mysql-connector-java-5.1.18-bin.jar 3. Copy mysql-connector jar file into your local glassfish server domains lib folder location example : C:glassfish4glassfishdomainsdomain1lib 4. Restart the glassfish server. 5. Open glassfish Server Administrator consol Go to ----> Resources -----> JDBC ----- > JDBC Connection Pools 6. Create New JDBC Connection Pool ---- > Click new button to displays following window Enter Connection Pool details: Pool Name: nvPool Resource Type: select javax.sql.Datasorce from dropdown list. Database Diver Vendor: select diver vendor MySql from dropdown list. Sumanbehara1@gmail.com
  • 2. JNDI Data source Setup in Glassfish Server 7. click next to shows the following window: a. You can change default Pool settings as per your requirement shows in below window. Like Initial and Minimum Pool Size, Maximum Pool Size, Pool Resize Quantity, Idle Timeout, Max Wait Time. b. Enter Your Local MySql database connection details: User: root Password: root Database Name: nvPortal Url: jdbc:mysql://localhost:3306/nvPortal sumanbehara1@gmail.com
  • 3. JNDI Data source Setup in Glassfish Server 8. Click finish to create nv Connection Pool. nvPool shows in connection pool list 9. Click on nvPool to displays the below window -----> Click on --- > Ping button. a. If database connection details are correct, message displays Ping Succeeded. Your Connection pool is created successfully. It shows following window. sumanbehara1@gmail.com
  • 4. JNDI Data source Setup in Glassfish Server b. If database connection details are not correct, message displays An error has occurred. It shows the following error window. Check your User Name, Password, database Name and Connection URL. 10. Create JDBC Resources. a. Go to ----> Resources -----> JDBC ----- >JDBC Resources b. Click to New button to displays following window sumanbehara1@gmail.com
  • 5. JNDI Data source Setup in Glassfish Server Enter JDBC resource Details: JNDI Name: jdbc/nvPortal Pool Name: Select nvPool from drop down list. Click Ok to create JDBC Resources successfully. Jdbc/nvPortal shows in JDBC resources. sumanbehara1@gmail.com
  • 6. JNDI Data source Setup in Glassfish Server *** Note: Jdbc/nvPortal name and in your spring application ----> /WEB-INF/etc/conf/jndi-dao- nvPortal-config.xml file contains JNDI name should be same. Example: in jndi-dao-nvPortal-config.xml <jee:jndi-lookup id="portalJNDI" jndi-name="jdbc/nvPortal"/> sumanbehara1@gmail.com