SlideShare a Scribd company logo
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

More Related Content

What's hot

Automated Testing ADF with Selenium
Automated Testing ADF with SeleniumAutomated Testing ADF with Selenium
Automated Testing ADF with Selenium
Wilfred van der Deijl
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And Walkthroughs
Bryan Tuttle
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure Functions
Jeremy 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 Director
Mayank Goyal
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript app
Justin 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.js
Doug Neiner
 
The Spring Update
The Spring UpdateThe Spring Update
The Spring Update
Gunnar Hillert
 
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
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
Saptak Sen
 
Redux Universal
Redux UniversalRedux Universal
Redux Universal
Nikolaus Graf
 
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
 
ReactJS for Beginners
ReactJS for BeginnersReactJS for Beginners
ReactJS for Beginners
Oswald Campesato
 
Database
DatabaseDatabase
Getting started with Elasticsearch in .net
Getting started with Elasticsearch in .netGetting started with Elasticsearch in .net
Getting started with Elasticsearch in .net
Ismaeel Enjreny
 
ASP.NET Lecture 6
ASP.NET Lecture 6ASP.NET Lecture 6
ASP.NET Lecture 6
Julie Iskander
 

What's hot (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
 

Viewers also liked

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 jersey
Eclipse 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 SOAP
Héctor Garduño Real
 
Desarrollando un API con REST
Desarrollando un API con RESTDesarrollando un API con REST
Desarrollando un API con REST
Alex 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 NetBeans
David Fernández Puentes
 
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)
Abimael Desales López
 
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
Marcio Junior Vieira
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
Christopher Bartling
 

Viewers also liked (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
 

Similar to Cejv659 week09 glassfish-s14

Spring jdbc dao
Spring jdbc daoSpring jdbc dao
Spring jdbc dao
Anuj Singh Rajput
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
Vikas Jagtap
 
SHOW104: Practical Java
SHOW104: Practical JavaSHOW104: Practical Java
SHOW104: Practical Java
Mark Myers
 
Accessing my sql_from_java
Accessing my sql_from_javaAccessing my sql_from_java
Accessing my sql_from_java
Tran Rean
 
Weblogic configuration
Weblogic configurationWeblogic configuration
Weblogic configuration
Aditya Bhuyan
 
Weblogic Cluster configuration
Weblogic Cluster configurationWeblogic Cluster configuration
Weblogic Cluster configuration
Aditya 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
 
Midao JDBC presentation
Midao JDBC presentationMidao JDBC presentation
Midao JDBC presentation
Zachar Prychoda
 
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
 
Mule data bases
Mule data basesMule data bases
Mule data bases
Naresh Naidu
 
JDBC-Introduction
JDBC-IntroductionJDBC-Introduction
JDBC-Introduction
Mythili Shankar
 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC Drivers
Kumar
 
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
ujjwalmatoliya
 
4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt4-INTERDUCATION TO JDBC-2019.ppt
4-INTERDUCATION TO JDBC-2019.ppt
NaveenKumar648465
 

Similar to 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
 

Recently uploaded

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 

Recently uploaded (20)

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.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