What Is An Enterprise Application?
What Is An Enterprise Application?
What Is An Enterprise Application?
Jayashree Chaudhari
Salespeople can log client information,including personal and product information and client location in the
sales pipeline.
Customer service representatives can track client issues and communication alongside internal responses
and updates.
Internal-facing employees can take client specifications to build the product.
Managers and C-level executives can track client and employee performance.
Java EE platform uses a distributed multi-tiered application model for enterprise applications.
Application logic is divided into components according to function and the application components that make
up a Java EE application are installed on various machines depending on the tier in the multi-tiered Java EE
environment to which the application component belongs.
In distributed computing ,an application is divided into smaller parts that run simultaneously on different
computers.
The smaller application parts are called tiers.
Each tier provides an independent set of services that can be consumed by connecting or client tier.
Enterprise architecture is divided into following tiers:
Client tier components run on the client machine.
Web tier components run on the Java EE server.
Business-tier components run on the Java EE server.
Enterprise Information system(EIS) tier software runs on the EIS server.
Most application have three distinct layers:
The presentation layer is responsible for the user interfaces.
The business layer executes the business rules.In the process it also interacts with the data access layer.
The data access layer is responsible retrieving and manipulating data stored in EIS.
Java EE Technologies
1.Web Application Technologies
1.1 Java Servlet API
The Java Servlet API lets you define HTTP specific classes.
A servlet class extends the capabilities of servers that host applications that are accessed by way of a
request response programming model.
Although servlets can respond to any type of request, they are commonly used to extend the applications
hosted by web servers.
Servlet can accept the input from an online form and print it back to the screen in an HTML page and
format or you might use a different servlet to write the data to a file or database instead.
A servlet runs on the server side.
Java Server Pages(JSP) technology provides simplified ,fast way to create dynamic web content.
JSP technology enables rapid development of web based applications that are server and platform
independent.
JSP page a text based document that contains two types of text:
Static data, which can be expressed in any text based format such as HTML, Wireless Markup Language
(WML) or XML.
JSP technology elements, which determine how the page constructs dynamic content.
The Java Server Pages Standard Tag Library (JSTL) encapsulates core functionality common to many JSP
technology based applications.
Instead of mixing tags from numerous vendors in your applications, you employ a single standard set of
tags.
This standardization allows you to deploy your applications on any JSP container that supports JSTL and
makes it more likely that the implementation of the tags is optimized.
JSTL has iterator and conditional tags for handling flow control ,tags for manipulating XML document,
internationalization tags,tags for accessing databases using SQL and tags for commonly used functions
1.4Java Server Faces Technology
1.5 Facelets
In Java Server Faces(JSF) Facelets is the default view declaration language(VDL) instead of Java Server
Pages(JSP) with Facelets,you don’t need to configure a view handler Facelets is based on
compositions.A composition defines a JSF UI Components structure in a Facelets page.
Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform,
Enterprise Edition (Java EE),EJB technology enables rapid and simplified development of distributed,
transactional ,secure and portable applications based on Java technology.
The Java Persistence API is Java technology standards –based solution for persistence.
Persistence uses an object –relational mapping approach to bridge the gap between an object oriented
model and relational database.
Java technology persistence consists of three areas:
The Java persistence API
The query language
Object relational mapping metadata
Web applications can use the JavaMail API to send email notifications.
The API has two parts:an application level interface that the application components use to send email and
a service provider interface.
Service providers implement particular email protocols ,such as SMTP .Several service providers are
included with the JavaMail API package,and others are available separately.
The Java EE platform includes the JavaMail extension with a service provider that allows application
components to send email.
Java Transaction API(JTA) specifies Java interface between a transaction manager and the parties involved in
a distributed transaction system: the resource manager ,the application server, and the transactional
applications.
Java EE Container
Q:Classify the EE containers.Explain Nov-18
List and explain Java Container types.Apr-19
The server and containers are as follows:
Java EE server: The runtime portion of a Java EE product. A Java EE server provides EJB and web
containers.
EJB container: Manages the execution of enterprise beans for Java EE applications. Enterprise beans
and their container run on the Java EE server.
Web container: Manages the execution of web pages, servlets, and some EJB components for Java
EE applications. Web components and their container run on the Java EE server.
Application client container: Manages the execution of application client components. Application
clients and their container run on the client.
Applet container: Manages the execution of applets. Consists of a web browser and a Java Plug-in
running on the client together.
One tier architecture has all the layers such as Presentation, Business, Data Access layers
in a single software package.
Applications which handles all the three tiers such as MP3 player, MS Office are come
under one tier application.
The data is stored in the local system or a shared drive.
Advantages:
1. Easy to implement and optimize performance.
2. Do not have compatibility or Context switching issues.
3. The cost of deployment is less.
E.g. Development and management cost.
Disadvantages:
1.Do not support remote/distributed access for data resources.
2.Monolithic manner of the code causes higher maintenance.
Two-Tier Architecture
Client system handles both Presentation and Application layers and Server system
handles Database layer.
It is also known as client server application.
The communication takes place between the Client and the Server.
Client system sends the request to the Server system and the Server system processes
the request and sends back the data to the Client System
Advantages
1.Easy to implement and modification is bit easy.
2.Communication is faster.
Disadvantages
1.In two tier architecture application performance will be degrade upon increasing the
users.
2.Cost-ineffective.
Three-Tier Architecture
Client system handles Presentation layer, Application server handles Application layer
and Server system handles Database layer.
1. Client layer: Represents Web browser, a Java or other application.Applet,WAP phone etc.
The client tier makes requests to the Web server who will be serving the request by either
returning static content if it is present in the web server or forwards the request to either
Servlet or JSP in the application server for either static or dynamic content.
2. Business layer: This layer provides the business services. This tier contains the business
Logic and business data. All the business logic like validation of data calculations, data
Insertion etc.
3. Data layer: This layer is the external resource such as a database,ERP system, Mainframe
System etc. responsible for storing the data. This tier is known as Data Tier.
Advantages:
1. High performance, lightweight persistent objects and better re-usability.
2. Scalability: Each tier can scale horizontally.
3. Performance: Because the presentation tier can cache requests, network utilization is
Minimized and the load is reduced on the Application and Data tiers.
4. Improved Security: Client is not direct access to database.
5.Improve Data Integrity.
6.Forced separation of user interface logic and business logic.
User clicks a link that has URL to a dynamic page instead of a static page.
The URL decides which CGI program to execute.
Web Servers run the CGI program in seperate OS shell. The shell includes OS enviroment and
the process to execute code of the CGI program.
The CGI response is sent back to the Web Server, which wraps the response in an HTTP
response and send it back to the web browser.
High resposne time because CGI programs execute in their own OS shell.
CGI is not scalable.
CGI programs are not always secure or object-oriented.
It is Platform dependent.
If the number of clients increases, it takes more time for sending the response.
Because of these disadvantages, developers started looking for better CGI solutions. And then Sun
Microsystems developed Servlet as a solution over traditional CGI technology.
A web application is an application accessible from the web. A web application is composed
of web components like Servlet, JSP, Filter, etc. and other elements such as HTML, CSS, and
JavaScript.
The web components typically execute in Web Server and respond to the HTTP request.
Servlet
Servlet technology is used to create a web application (resides at server side and
generates a dynamic web page).
Servlet technology is robust and scalable because of java language.
There are many interfaces and classes in the Servlet API such as Servlet, GenericServlet,
HttpServlet, ServletRequest, ServletResponse, etc.
What is a Servlet?
o Servlet is a technology which is used to create a web application.
o Servlet is an API that provides many interfaces and classes including documentation.
o Servlet is an interface that must be implemented for creating any Servlet.
o Servlet is a class that extends the capabilities of the servers and responds to the incoming
requests. It can respond to any requests.
o Servlet is a web component that is deployed on the server to create a dynamic web page.
Servlet Advantages
Performance is significantly better.
Servlets executes within the address space of a web server.It is not create a separate
process to handle each client request.
Servlets are platform independent because they are written in Java.
Java security manager on the server enforces set of restrictions to protect the
resources on a server machine.so servlets are trusted.
The full functionality of Java class libraries is available to servlet. It can communicate
with applet, database or other software via the sockets and RMI mechanisms that you
have seen already.
The JDBC API supports both two-tier and three-tier processing models for database access but
in general, JDBC Architecture consists of two layers −
• JDBC API: This provides the application-to-JDBC Manager connection.
• JDBC Driver API: This supports the JDBC Manager-to-Driver Connection.
The JDBC API uses a driver manager and database-specific drivers to provide transparent
connectivity to heterogeneous databases.
The JDBC driver manager ensures that the correct driver is used to access each data source.
The driver manager is capable of supporting multiple concurrent drivers connected to multiple
heterogeneous databases.
Following is the architectural diagram, which shows the location of the driver manager with respect
to the JDBC drivers and the Java application –
TYPES OF DRIVER
List and explain 4 types of JDBC driver Nov-19
TYPE 1 DRIVER-JDBC-ODBC BRIDGE
This driver converts JDBC method calls into ODBC function calls.
This driver is platform dependent as it makes use of ODBC which depends on native libraries
of the underlying OS also use of thise driver leads to other installation dependencies.
for example odbc must be installed on the computer having the driver and the database must
support an ODBC driver
Advantages:
• It is very easy to use.
• Almost any database is supported.
Limitations:
• Performance will not be efficient.
• ODBC driver needs to be installed.
• Type 1 drivers are not portable.
Advantages
• Faster than Type 1 Driver
Limitations
• Client side Library is not available for all
databases.
• Vendor Client Library needs to be installed.
• It is a Platform dependent.
• Not Thread safe.
TYPE 3 –NETWORK PROTOCOL DRIVER(MIDDLEWARE DRIVER)
Type 3 driver also known as pure Java driver for database middleware, is a database driver
implementation which makes use of middle tier between the calling program and the
database .The middle tier converts JDBC calls directly or indirectly into the vendor-specific
database protocol.
The same driver can be used for multiple databases. The type 3 driver is platform
independent as platform related differences are taken care of by the middleware. Allso
making use of middleware provides additional advantages of security and Firewall access
Advantages:
• No additional library installation is required on
client system.
• No changes are required at client for any DB.
• Supports caching of connection ,Query
results,Load Balancing ,Logging and Auditing etc.
• A Single Driver can handle any database provided
the middleware supports it.
Limitations
• Performance will be slow.
• Requires Database –specific coding
• Maintenance of Network Protocol Driver becomes
costly.
Cursor move only in forward Cursor can move both forward and
direction backward direction
//cleanup
rs.close();
stmt.close();
con.close();
}
}
Transcation Management in JDBC
A transaction is a group of operation is used to performed one task if all operations in the
group are success then the task is finished and transaction successfully completed.
If any one operation in the group is failed then the task is failed and transaction is failed.
Suppose a movie ticket booking at online is a transaction. This task contains four operation.
a.Verify the seats
b.Reserve the seats
c.Payment
d.Issue tickets
If all the above four operations are done successfully then a transaction is finished
successfully. In the middle, if any one operation is failed then all operation are canceled and
finally a transaction is failed.
Properties of Transaction managements
Every transaction follows some transaction properties these are called ACID properties.
ROWSET
Explain ROWSET and its types in JDBC.APR-19
Why need RowSet?
Database Management Systems or the drivers providedby some database vendors do not support
result setsthat are scrollable and/or updatable.
Benefits of RowSet
provides scrollability and updatability for any kind of DBMS or driver.
A RowSet object, being a JavaBeans component can be used to notify other registered GUI
components of a change.
Types of RowSets
RowSets are classified depending on the duration of their connection to the database
=> Connected or Disconnected
A connected Rowset obj uses a JDBC driver to establish a connection that maintained throughout the
lifespan of the RowSet obj.
A disconnected RowSet obj connect to read or write. After completion, it disconnects from the data
source.
Implementation of “RowSet”
CachedRowSet . disconnected rowset that caches its data in memory . Ideal way to provide thin Java
clients (PDA …)
JdbcRowSet . connected rowset that serves mainly as a think wrapper around ResultSet object
WebRowSet . connected rowset that uses the HTTP protocol internally to talk to a Java servlet that
provides data access
CachedRowSet stores or caches its data in memory so that it can operate on its on data rather than
depending on the data stored in a db. http://pastebin.com/6haZewcS
JdbcRowSet A JdbcRowSet obj is an enhanced and extended ResultSet obj which has certain
properties and a listener mechanism that make it a JavaBeans components