TDDD05 EJB Lab (Part of slides reused from Mikhail’s) Lu Li

Slides:



Advertisements
Similar presentations
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
Advertisements

19 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Developing Web Services.
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
Integrating SOA and the Application Development Framework Shaun O’Brien Principal Product Manager – Oracle JDeveloper / ADF.
Why OSGi matters for Enterprise Java Infrastructures
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
Enterprise Java Beans Welcome to the world of “Distributed System” Presented By: Sameer Nanda Date: 12/17/03.
Application Server Lecture Paulo Barroso Kris Carver Todd Kitterman Eric Silva.
Point Of Sale(POS) J2EE Application Department : Computer Science Degree : Master Student : Woojin Choi ID : (POS J2EE Application with JRun)
Java 2 – Enterprise Edition Kevin J. LaFata April 21, 2003 UM – St. Louis.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Current Topics in Programming Languages Lecture 15_1 George Koutsogiannakis SUMMER
Introduction to EJB INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
ECE356 – Database Systems Lab 1 – Building a Web Project with NetBeans Tiuley Alguindigue Lab Instructor – University of Waterloo, E & CE Dept. Fall 2013.
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Java Frameworks Indy Java Users Group January 29, 2003.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
4-Tier Model Client Tier Web Tier Business Tier EIS Tier.
1 Session Bean Chuyên đề Lập trình Java & J2EE Chương 14 Biên soạn: Th.S Nguyễn văn Lành.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Enterprise JavaBeans EJB Container Services. EJB container Enterprise JavaBeans are deployed in an EJB container within the application server EJB container.
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
Enterprise Java Beans Part I Kyungmin Cho 2001/04/10.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
Connecting to the Enterprise Using VisiConnect David Lucas President Lucas Software Engineering, Inc
Overview Of Enterprise Java Bean (EJB) COSC 513 Presentation Mei Li March 17, 2001.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
CD Database Server (CDDB) Zachary Carter Alan Savage Diana Abbas Kyle Dorman.
Presented By Pradeep K Sahu. What will be the Contents of the Seminar ? What is EJB ? EJB Architecture Types of EJB Session Entity Why EJB ? Writing a.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Introduction to J2EE Architecture Portions by Kunal Mehta.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
Enterprise Java Overview Panos Konstantinidis Java Developer JUG Leader & Java Champion
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
17 Copyright © 2004, Oracle. All rights reserved. Deploying an ADF Application.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Introduction – ORM, Helloworld Application
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
EJB Enterprise Java Beans JAVA Enterprise Edition
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
17 Copyright © 2004, Oracle. All rights reserved. Integrating J2EE Components.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Introduction to J2EE Architecture
J2EE Application Development
Introduction to Enterprise JavaBean
Understanding and Designing with EJB
Objectives In this lesson, you will learn to:
Component-based Applications
Enterprise Java Beans.
Presentation transcript:

TDDD05 EJB Lab (Part of slides reused from Mikhail’s) Lu Li

Agenda EJB brief introduction Practical hints

Why EJB EJBs is a powerful component model for building distributed, server-side, and Java- based enterprise application components. Code reuse by middleware service, such as object life-cycle management, resource (beans, database connection) mapping etc.

EJB architecture

Connect Glassfish to Database Configure MySQL database Copy driver to Glassfish directory Configure a connection pool (For example “TDDD05_MySQL”), and do a ping test Configure JDBC resource (For example “TDDD05_JDBC”) to use the connection pool (“TDDD05_MySQL”)

Create an JPA to use database JPA is a kind of EJB for interaction with database. Configure persistence.xml under META-INF folder, if no such xml file found, create one.

Create an Stateless Bean Create a EJB project Add library appserv-rt.jar, j2ee.jar

Create an Stateless Bean Create an interface

Create an Stateless Bean Create an implementation

Deploy EJB Export jar Start Glassfish Copy jar file into the autodeploy directory Check the file generated There is another way to deploy. (Covered later)

JNDI lookup

JNDI Application

Dependency injection

DI Application

Deployment (Glassfish_Home)/bin/asadmin deploy – retrieve. Ex1-ee.ear Execution (Glassfish_Home)/bin/Appclient –client./ex1- eeClient.jar –mainclass client.AppClient

Facade

Summary You needs a MySQL with a designed table. You needs to make a Glassfish to know the connection to your MySQL You needs a JPA to use the connection and interact with MySQL You needs a Stateless session bean to use the JPA.

Summary You needs to declare an interface to expose functionality to external clients. You needs a JNDI lookup client which can run independently You needs a DI client in connection with EJB (Two components are package in EAR project), to be deployed in Glassfish and invoke them by Appclient.

Some suggestions Try to understand how different components interact with each other at implementation level. Do a thorough unit testing before integrating all components together Today’s lesson covers most but not all steps needed for lab 2. Feel free to change some steps if you think it is necessary.

Questions?