SlideShare une entreprise Scribd logo
1  sur  16
Java IV: Web Services
Development
CEJV659
Configuring Glassfish for MySQL
REST, JPA, NetBeans and GlassFish
 NetBeans provides wizards for creating RESTful CRUD
applications
 They can be created from either existing JPA entities or
directly from a database
 The wizards create stateless session beans for the web
service
 While TomEE supports session beans the wizard
generates code that is not compatible with TomEE
 Therefore we need to use the GlassFish server
6/2/2014 2
REST, JPA, NetBeans and Glassfish
 A second problem is the database support in GlassFish
 When installed this server is configured with the Derby
sample database
 The purpose of these slides is show how to configure
GlassFish for MySQL and then use the wizards
 The database we will use is the single table Aquarium
 The goal is to create web services that sample programs
used in Java II and Java III can use
6/2/2014 3
MySQL
 Before you can configure GlassFish you must have
MySQL running and the database created
 Next, you must copy the mysql driver to GlassFish
 Download the latest driver from MySQL
 For Windows it is now an install (msi) file
 When run the driver will be found in
C:Program Files (x86)MySQLMySQL Connector J
 Copy mysql-connector-java-5.1.30-bin.jar to
glassfish-install-pathdomainsdomain-namelib
 If GlassFish is running then restart the server
6/2/2014 4
Configuring Glassfish
 Step 1
 On the Services tab open Servers and right mouse click
on GlassFish Server 4
 Select Start
 Once GlassFish is running right mouse click on
GlassFish Server 4 again and click on View Domain
Admin Console
6/2/2014 5
6/2/2014 6
Resource and Connection Pool
 To work with a database you need to
configure the resource and the pool
 Resources provide applications a means
to connect to a database
 Connection Pools provide reusable
connections to the database
 The application uses a resource to
access the database and the resource
uses the pool to get a connection
 We need to create the pool before the
resource
6/2/2014 7
JDBC Connection Pool
 Select JDBC Connection Pool on the tree and then
select New on the table that appears.
6/2/2014 8
JDBC Connection Pool
 Fill in the form as shown and click on Next.
6/2/2014 9
JDBC Connection Pool
 The next form has been filled out based on the choice of
MySQL as the database
 Nothing has to be changed except that you should check
Ping: Enabled
10
JDBC Connection Pool
 If you scroll down on the form you will come to Additional
Properties
 After adding the 4 values click on Finish
6/2/2014 11
JDBC Connection Pool
 This what you should see
 If the Ping was not successful just delete the resource or
even the pool and start over.
12
JDBC Resource
 A connection pool object will now manage the
connections to the database
 Our application needs to request a connection from this
object that is not part of our application
 The Java Naming and Directory Interface (JNDI) allows
us to refer to an object that belongs to another process,
such as GlassFish, by a name
 A JDBC Resource allows you to assign a JNDI name for
the connection pool you wish to use
 When your code uses a JNDI name the object is located
and made available
6/2/2014 13
JDBC Resource
 From the Common Tasks select JDBC Resources
 Click on New
6/2/2014 14
JDBC Resource
 Now you need to give the resource its JNDI name
 It usually begins with a prefix that identifies the type of resource
followed by the name you have chosen such as jdbc/aquarium
 Select the pool to associate with the resource from the drop down
Pool Name.
15
JDBC Resource
 Here is what you should see if you have been successful
 You are now ready to use the NetBeans wizards
6/2/2014 16

Contenu connexe

Tendances

Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And WalkthroughsBryan Tuttle
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure FunctionsJeremy Likness
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation洪 鹏发
 
Query service in vCloud Director
Query service in vCloud DirectorQuery service in vCloud Director
Query service in vCloud DirectorMayank Goyal
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript appJustin Park
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps. Emanuele DelBono
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.jsDoug Neiner
 
All About Asp Net 4 0 Hosam Kamel
All About Asp Net 4 0  Hosam KamelAll About Asp Net 4 0  Hosam Kamel
All About Asp Net 4 0 Hosam KamelHosam Kamel
 
Data Management in Microsoft HDInsight: How to Move and Store Your Data
Data Management in Microsoft HDInsight: How to Move and Store Your DataData Management in Microsoft HDInsight: How to Move and Store Your Data
Data Management in Microsoft HDInsight: How to Move and Store Your DataSaptak Sen
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
Getting started with Elasticsearch in .net
Getting started with Elasticsearch in .netGetting started with Elasticsearch in .net
Getting started with Elasticsearch in .netIsmaeel Enjreny
 

Tendances (19)

Automated Testing ADF with Selenium
Automated Testing ADF with SeleniumAutomated Testing ADF with Selenium
Automated Testing ADF with Selenium
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And Walkthroughs
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure Functions
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Query service in vCloud Director
Query service in vCloud DirectorQuery service in vCloud Director
Query service in vCloud Director
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript app
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps.
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.js
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
 
The Spring Update
The Spring UpdateThe Spring Update
The Spring Update
 
All About Asp Net 4 0 Hosam Kamel
All About Asp Net 4 0  Hosam KamelAll About Asp Net 4 0  Hosam Kamel
All About Asp Net 4 0 Hosam Kamel
 
Data Management in Microsoft HDInsight: How to Move and Store Your Data
Data Management in Microsoft HDInsight: How to Move and Store Your DataData Management in Microsoft HDInsight: How to Move and Store Your Data
Data Management in Microsoft HDInsight: How to Move and Store Your Data
 
Redux Universal
Redux UniversalRedux Universal
Redux Universal
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
ReactJS for Beginners
ReactJS for BeginnersReactJS for Beginners
ReactJS for Beginners
 
Database
DatabaseDatabase
Database
 
Getting started with Elasticsearch in .net
Getting started with Elasticsearch in .netGetting started with Elasticsearch in .net
Getting started with Elasticsearch in .net
 
ASP.NET Lecture 6
ASP.NET Lecture 6ASP.NET Lecture 6
ASP.NET Lecture 6
 

En vedette

Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...Arun Gupta
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)Rudy De Busscher
 
Eclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jerseyEclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jerseyEclipse Day India
 
Manual de creación y uso de Web Service SOAP
Manual de creación y uso de Web Service SOAPManual de creación y uso de Web Service SOAP
Manual de creación y uso de Web Service SOAPHéctor Garduño Real
 
Desarrollando un API con REST
Desarrollando un API con RESTDesarrollando un API con REST
Desarrollando un API con RESTAlex Puig
 
Diseño de Patrones (Fachada)
Diseño de Patrones (Fachada)Diseño de Patrones (Fachada)
Diseño de Patrones (Fachada)Fanny Ruiz
 
Creando un servicio SOAP en Java con NetBeans
Creando un servicio SOAP en Java con NetBeansCreando un servicio SOAP en Java con NetBeans
Creando un servicio SOAP en Java con NetBeansDavid Fernández Puentes
 
Criando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSONCriando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSONMarcio Junior Vieira
 

En vedette (12)

Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)
 
Creating i os or android application with sql server as database
Creating i os or android application with sql server as databaseCreating i os or android application with sql server as database
Creating i os or android application with sql server as database
 
Eclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jerseyEclipse Day India 2015 - Rest with Java (jax rs) and jersey
Eclipse Day India 2015 - Rest with Java (jax rs) and jersey
 
Manual de creación y uso de Web Service SOAP
Manual de creación y uso de Web Service SOAPManual de creación y uso de Web Service SOAP
Manual de creación y uso de Web Service SOAP
 
Desarrollando un API con REST
Desarrollando un API con RESTDesarrollando un API con REST
Desarrollando un API con REST
 
Diseño de Patrones (Fachada)
Diseño de Patrones (Fachada)Diseño de Patrones (Fachada)
Diseño de Patrones (Fachada)
 
Creando un servicio SOAP en Java con NetBeans
Creando un servicio SOAP en Java con NetBeansCreando un servicio SOAP en Java con NetBeans
Creando un servicio SOAP en Java con NetBeans
 
Tutorial - REST con java (JAX-RS 2.0)
Tutorial - REST con java (JAX-RS 2.0)Tutorial - REST con java (JAX-RS 2.0)
Tutorial - REST con java (JAX-RS 2.0)
 
Criando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSONCriando e consumindo webservice REST com PHP e JSON
Criando e consumindo webservice REST com PHP e JSON
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 

Similaire à Cejv659 week09 glassfish-s14

SHOW104: Practical Java
SHOW104: Practical JavaSHOW104: Practical Java
SHOW104: Practical JavaMark Myers
 
Accessing my sql_from_java
Accessing my sql_from_javaAccessing my sql_from_java
Accessing my sql_from_javaTran Rean
 
Weblogic configuration
Weblogic configurationWeblogic configuration
Weblogic configurationAditya Bhuyan
 
Weblogic Cluster configuration
Weblogic Cluster configurationWeblogic Cluster configuration
Weblogic Cluster configurationAditya Bhuyan
 
Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)Som Prakash Rai
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversKumar
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptxujjwalmatoliya
 
4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.pptNaveenKumar648465
 

Similaire à Cejv659 week09 glassfish-s14 (20)

Spring jdbc dao
Spring jdbc daoSpring jdbc dao
Spring jdbc dao
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
SHOW104: Practical Java
SHOW104: Practical JavaSHOW104: Practical Java
SHOW104: Practical Java
 
Accessing my sql_from_java
Accessing my sql_from_javaAccessing my sql_from_java
Accessing my sql_from_java
 
Weblogic configuration
Weblogic configurationWeblogic configuration
Weblogic configuration
 
Weblogic Cluster configuration
Weblogic Cluster configurationWeblogic Cluster configuration
Weblogic Cluster configuration
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)Jdbc Complete Notes by Java Training Center (Som Sir)
Jdbc Complete Notes by Java Training Center (Som Sir)
 
Midao JDBC presentation
Midao JDBC presentationMidao JDBC presentation
Midao JDBC presentation
 
Spring database - part2
Spring database -  part2Spring database -  part2
Spring database - part2
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Mule data bases
Mule data basesMule data bases
Mule data bases
 
JDBC-Introduction
JDBC-IntroductionJDBC-Introduction
JDBC-Introduction
 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC Drivers
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 
4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt
 

Dernier

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Dernier (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Cejv659 week09 glassfish-s14

  • 1. Java IV: Web Services Development CEJV659 Configuring Glassfish for MySQL
  • 2. REST, JPA, NetBeans and GlassFish  NetBeans provides wizards for creating RESTful CRUD applications  They can be created from either existing JPA entities or directly from a database  The wizards create stateless session beans for the web service  While TomEE supports session beans the wizard generates code that is not compatible with TomEE  Therefore we need to use the GlassFish server 6/2/2014 2
  • 3. REST, JPA, NetBeans and Glassfish  A second problem is the database support in GlassFish  When installed this server is configured with the Derby sample database  The purpose of these slides is show how to configure GlassFish for MySQL and then use the wizards  The database we will use is the single table Aquarium  The goal is to create web services that sample programs used in Java II and Java III can use 6/2/2014 3
  • 4. MySQL  Before you can configure GlassFish you must have MySQL running and the database created  Next, you must copy the mysql driver to GlassFish  Download the latest driver from MySQL  For Windows it is now an install (msi) file  When run the driver will be found in C:Program Files (x86)MySQLMySQL Connector J  Copy mysql-connector-java-5.1.30-bin.jar to glassfish-install-pathdomainsdomain-namelib  If GlassFish is running then restart the server 6/2/2014 4
  • 5. Configuring Glassfish  Step 1  On the Services tab open Servers and right mouse click on GlassFish Server 4  Select Start  Once GlassFish is running right mouse click on GlassFish Server 4 again and click on View Domain Admin Console 6/2/2014 5
  • 7. Resource and Connection Pool  To work with a database you need to configure the resource and the pool  Resources provide applications a means to connect to a database  Connection Pools provide reusable connections to the database  The application uses a resource to access the database and the resource uses the pool to get a connection  We need to create the pool before the resource 6/2/2014 7
  • 8. JDBC Connection Pool  Select JDBC Connection Pool on the tree and then select New on the table that appears. 6/2/2014 8
  • 9. JDBC Connection Pool  Fill in the form as shown and click on Next. 6/2/2014 9
  • 10. JDBC Connection Pool  The next form has been filled out based on the choice of MySQL as the database  Nothing has to be changed except that you should check Ping: Enabled 10
  • 11. JDBC Connection Pool  If you scroll down on the form you will come to Additional Properties  After adding the 4 values click on Finish 6/2/2014 11
  • 12. JDBC Connection Pool  This what you should see  If the Ping was not successful just delete the resource or even the pool and start over. 12
  • 13. JDBC Resource  A connection pool object will now manage the connections to the database  Our application needs to request a connection from this object that is not part of our application  The Java Naming and Directory Interface (JNDI) allows us to refer to an object that belongs to another process, such as GlassFish, by a name  A JDBC Resource allows you to assign a JNDI name for the connection pool you wish to use  When your code uses a JNDI name the object is located and made available 6/2/2014 13
  • 14. JDBC Resource  From the Common Tasks select JDBC Resources  Click on New 6/2/2014 14
  • 15. JDBC Resource  Now you need to give the resource its JNDI name  It usually begins with a prefix that identifies the type of resource followed by the name you have chosen such as jdbc/aquarium  Select the pool to associate with the resource from the drop down Pool Name. 15
  • 16. JDBC Resource  Here is what you should see if you have been successful  You are now ready to use the NetBeans wizards 6/2/2014 16