KENNESAW STATE UNIVERSITY

yoinkscreechedInternet and Web Development

Nov 13, 2013 (3 years and 8 months ago)

54 views


1

KENNESAW STATE UNIVERSITY




COMPUTER SCIENCE AND COMPUTER
INFORMATION SYSTEMS DEPARTMENT



CS8630



Term Paper:




SYED SHUJAAT ALI


Web Technologies and DBMS: Implement an application that accesses a database over
the web through an application that acc
esses a database over the web through at least two
different technologies:
e.g
java & .net etc. Compare the two technologies used:








2

Introduction:

For my project
I am going to use JSP (Java Server Pages)

through

JDeveloper tool to

connect to Oracle Dat
abase and implement the application.
In my
paper
,

I will describe
the basics

of the

web technolog
y and Data Base Management
Systems
, and
outline
how
I will
implement
my project
.

Then I will compare the Java
Server Pages and Active Server Pages

technologies
.


Internet is a world wide collection of interconnected computer networks.


The
World Wide Web

is a hypermedia based system that provides a simple means to explore
the information on the internet in a non sequential way.
Whereas in e
-
commerce
customers c
an place and pay for orders via the business’s web site and in e
-
Business
there is complete integration of internet technology into the economic infrastructure of
the business.
Information on the web is stored in documents using HTML (Hyper Test
Markup Lan
guage
) which

is the document formatting language used to design most web
pages,
and displayed by a web browser. The web browser exchanges information with a
web server using
HTTP (Hyper

Text Transfer Protocol)
. URL is a string of alphanumeric
characters th
at represents the location or address of a resource on the internet and how
that resource should be accessed.


An HTML document stored in a file is an example of a static web page, whereas
the content of a
dynamic

web page is generated each time it is acc
essed. When the
documents to be published are dynamic, such as those resulting from queries t
o
databases, the hypertext needs

to be generated by the server. To achieve this, we can
write scripts that perform conversions from different data formats into HTM
L on the fly.
These scripts need to understand the queries performed by clients through HTML forms
and the results generated by the applications owning the data
e.g.

DBMS. As a database

3

is dynamic, changing as users create, insert, update and delete data,
then generating
dynamic web pages is a much more appropriate approach.


In the web environment, the traditional two tier client server model has been
replaced by a three tier model, consisting of a user interface layer the client, a business
logic and data

processing layer the application server, and a DBMS the database server
distributed over different machines. The requirements for web


DBMS integration are
simplicity which was being provided by HTML but as scripting languages are being
embedded within
HTML the original simplicity is disappearing. A compelling reason for
creating a web based version of a database application is that web clients
(the

browsers)
are mostly platform independent. But web browser vendors provide propriety features
and the bene
fits of this advantage are disappearing

as well
.

Graphical User Interface
provided by vendors requires extensive programming and tend
s

to be platform dependent
and in many cases vendor specific. Whereas web browsers provide a common, easy to
use GUI that c
an be used to access many t
hings, including a database, o
ther advantages
are standardization, cross platform support, transparent network access, and scalable
deployment. The disadvantages are lack of reliability, poor security, cost, poor
scalability,
and

limited

functionality of HTML, statelessness, bandwidth,
performance

and immaturity.



The Oracle internet platform, comprising of Oracle internet application server
(
IAS
) and the Oracle DBMS is aimed
particularly at providing extensibility for
distribute
d environments. It is an n
-
tier architecture based on industry standards such as
HTTP, HTML/XML for web enablement

for

my project I will use the oracle database
new version 10g, which
oracle has come out with
recently
. Here are some of its features:


4

Oracle

10G
’s

grid strategy for IT using enterprise grid computing instead of islands of
infrastructure
, gives the advantage of coordinated use of many servers acting as one large
computer and capacity is reallocated and added quickly and economically where
it is
needed.


In the three tier architecture
, the

grid has the application server grid, database
grid, and the storage grid. These three grids are managed by the
control grid
, which
provides workload management and high availability, automates provisioni
ng of grid
resources and monitors application
performance.
Instead of isolated applications,

it has

responsive software architecture

which develops and manages reusable software services
to improve flexibility and productivity

and responds to changing requ
irements quickly
.


It unifies web and wireless access on a single framework, builds software from
reusable business services, and simplifies integration with a standards based platform.

Oracle application Server 10g provides integrated middleware platform

and integrated
development platform
. The benefits of the grid
are automated

provisioning, automatically
setsup CPUs
, applications
, or

time based policies. It uses resource pooling,
does load

balancing and

provides failover support. There is no planned or
unplanned downtime.
It
has the breadth and depth for strategic IT initiatives provides self service applications, e
-
commerce, enterprise portals, identity management, regulatory compliance, web
services, application integration, business process auto
mation, mobile and wireless
connectivity and business intelligence.


Scripting languages such as java script and VBscript can be used to extend both
the browser and the server. Scripting languages allow the creation of functions embedded
within HTML stand
ard programming logic such as loops, conditional statements, etc.


5

Newer approached to integrating the web and the DBMS are Common gateway interface,
HTTP cookies, extensions to the web server such as the
Netscape

API and Microsoft’s
internet information se
rver API, Java and JDBC, SQLJ, servlets and Java Server Pages,
Microsoft’s web solution platform with active server pages (ASPs)

a
nd active X data
objects (ADO) and oracle’s internet platform.



The common gateway interface (CGI) is a specification for tra
nsferring
information between a web server and a CGI script. It is a popular technique for
integrating information
between a

web server and a CGI script. It is a popular technique
for integrating databases into the web. Its advantages include simplicity
, language
independence. Web server independence, and its wide acceptance. Disadvantages stem
from the fact that a new process is created for each invocation of the CGI script, which
can overload the web server during peak times.
An alternative approach t
o CGI is to
extend the web server, typified by the Netscape API provides server side java script
constructs for database connectivity. In this case java script is compiled into
byte codes

and interpreted by the livewire pro server extension running in con
junction with the
Netscape

server and accomplish many of the tasks usually associated with retrieving and
working with information from a database including connecting, and disconnecting from
the database, displaying the results of an SQL query and creatin
g updatable cursors for
viewing,

inserting, deleting and modifying data.


Where as java is a simple, object
-
oriented, distributed, interpreted, robust, secure,
architecture
-
neutral, portable, high performance, multi
-
threaded, and dynamic language
from Sun
Microsystems. Java applications are complied into
byte codes
, which are

6

interpreted and executed by the java virtual machine. Java can be connected to an ODBC
complaint DBMS through among other mechanisms, JDBC or SQLJ.


JDeveloper is an amazing developme
nt environment. With the Oracle Application
Developer Framework (ADF), which includes
Top link
, BC4J and Struts, I will develop a
GUI/HTML
-
based Web application using this point and click, drag and drop
development tool. I will discuss:

How ADF allows you
to map a database object into an ADF Business Component

ADF Business component view objects

ADF Business Component Application Modules

ADF Data Bindings and control components

The Struts Controller

The Java Server Page

Oracle JDeveloper is a J2EE developme
nt environment whereas J2EE
is
(Java 2
Enterprise Edition)

A Java
-
based, runtime platform created by Sun Microsystems used
for developing, deploying, and managing multi
-
tier server
-
centric applications on an
enterprise
-
wide scale. J2EE builds on the featur
es of J2SE and adds distributed
communication, threading control, scalable architecture, and transaction management.
J2EE is a competitor to the Microsoft .NET Framework.


It has end to end support for
modeling, developing, debugging, and deploying e
-
busin
ess

applications and Web
services. Oracle JDeveloper allows developers to build from scratch or by using a J2EE
framework. Whatever implementation is chosen, JDeveloper offers all the productivity
tools needed to get the job done.


7


Oracle ADF

(application

development framework
) is

a comprehensive
productivity layer for J2EE developers.

It brings the power of J2EE to all developers.
It
simplifies building applications as a set of business services with Web, Wireless, and
Rich Client interfaces. ADF acceler
ates development with ready to use J2EE Design
Pattern implementations and metadata driven components that
you‘d

otherwise have to
code, test, and debug by hand.

It bridges the usability gap with Case tools. It increases
productivity and the ease of use.
It has visual and declarative development.
L
ess coding
has to be done
as there is more reuse.


T
he core of the Struts framework is a flexible control layer based on standard
technologies like java Servlets, JavaBeans,
Resource Bundles
, and XML, as well as
various Jakarta commons packages.
Struts encourage

application architect
ures based on
the model 2 approach, a variation of the classic Model
-
view

controller (
MVC)

design
paradigm. Struts provide

the controller component and default request dispatcher for
the
web application.

In addition, they provide

comp
onents that can be utilized
by struts

enabled application to manage integration with data access and delivery to the
presentation layer.


To create the application using JDeveloper these are the steps I
will go through:

From the oracle home go to JDeveloper and start
it. Right click on workspace in
the
navigator. Click on new
application workspace

and name the workspace whatever
you wish ‘TermProject’. Use the default application template

(Web Applicatio
n).
Application workspace is created.

Model and view
controller:

2 new projects are automatically created under the model and
view controller.


8

Create a diagram of Business Components: Right click on model and then click on
new.

From the gallery, choose Bu
siness
components under

category
Business
components Diagram and click ok.

Name your business component diagram as you
wish. Now you are
finished setting

up your environment. Now it is time to
build

your
application.

Create a persistent Business object: th
ese are entity objects,
implement the

data
access object

design pattern

responsible for

persisting, caching and
validating data
.
Create
dragging a

table object and

dropping in

the diagram.

Connecting to the database:
To connect to the database in the navig
ator select
Connections at the bottom tab. Right click on ‘Database’. Select new database
connection. Name the
connection;

specify a username and password to connect to.
Specify the connection parameters (i.e.
The

database and

machine to connect to)
.
Then

click test connection to test whether the connection has been established.

Drag and drop tables that are going to be used to
build

the application. In the
navigator, drill into the new connection’s tables. Drag and drop a
table into

the
business compo
nents diagram
.

Editing the object: You can
edit the

persistent
business object by

double
clicking it
.
Edit, add or
delete attributes
, turn on batch updates
, establish

validation and
authentication rules, publish
and subscribe events
.
This is

a BC4J OR
EJB object

that
encapsulates all

the
business rules for

the object.

If you add
objects that

have referential
integrity established, JDeveloper
automatically picks up

on these relationships.


9

Create a view object: this object gathers and filters
data stor
ed

in the

entity object
,
uses a

SQL
query to

form a

collection
of data
. It can comprise of
multiple entity

objects (
i.e.

join tables
).

Create the view object: in the business components diagram click view object, then
click in business
components to

place



name the view (i.e. EmpView). It is empty
view (i.e. no entities to pull yet).

Place the Entity Objects: drag and
drop the

entity
objects (
i.e.

and Dept)
into the

view object (i.e. EmpView). A 1:1 mapping is created
from the entity object by default (i
.e. all columns and all rows). Adding the related
tables will automatically create the join statement.

Editing the

view object: you
can edit

the view object, add
additional entity objects
into the

view (or
use the

drag and

drop). Add or remove
attributes

from

the entities
selected
.
Edit the

query manually; add a where or order by clause.
Set fetch

sizes
,
query

hints, etc.


Create an application module: the application
module is

a service object that

coordinates view

objects for

a specific task (i.e.
A

fo
rm to

display the
employee
data
).

Building the application module: In business components
diagram click

‘application
module’, then
click in

business components to

place. Name
the module

(EmpModule). Have an empty module (
i.e.

No

views to pull yet). Drag

and drop the
view (i.e. EmpView) into the module.

Editing the application module; You can edit the attributes of the application
module by double clicking it, just like the other objects. These
objects can

be
deployed as

EJB, Cobra
, or

web servic
e objects
.


10

All the
business components

have been created: entity object, view object, and
application module, now it is time to create GUI application.

Diagram a Page Flow (Controller):

This is
our View Controller

section of the MVC.
The controller (i.e
. Struts)
separates the

visual representation

of web pages (view)
from their flow and actions. For creating the forward
action double

click struts
-
config.xml in

the navigator. Then
click ‘Page

forward’ in

the
component

palette.
Then
click in

the StrutsPa
geFlow
window to

place the

page. Change the name from
‘page1’ (don’t remove the forward slash).

Design
the JSP

Page
-

View
:
Create JSP

page that
automatically binds

a struts action.
Double
click the

Struts/forward action icon on the
page flow

diagram. Name

the Java
Server Page.

Dropping Business Components:

utilizing the

business service you

created in

the model, we

will create

the JSP. In the ‘Data Control Palette’,
select the

view object

(i.e. EmpView).
Select how

you
wish to

drop the

object into

the p
age

(i.e. HTML table, input form
, read

only form
, graph, etc.)

Drag and drop
it onto

the
page.

The Default JSP Page:
By dragging and

dropping the

EmpView
object as

an
‘Input
Form’

each
column from

the tables

is displayed.
Note that

no navigation buttons e
xist
(only submit) by default.
To add
navigation in

the ‘Data Control Palette’
under the

view and

under ‘operations’ you
will find

navigation operations which can be
dragged and dropped onto the page.

Running the application: Back up to StrutsPageFlow di
agram,
notice that

the Data
action element was added. Right
click on

data
action element and

choose run. The
form is
complete and

fully functional: you can do insert, update and delete. It is

11

HTML based. It is easy to deploy
using the

one
-
click deployment.

To add a List of
Values
delete the

Deptno input field,
find the

Deptno in the data control palette, select
drop as List of Values. Drop field in form.

Associate

LOV to this field and select the
UI model icon. Edit
the UI

model’s Deptno object
.
Create the

LOV by
choosing the

LOV source the DeptView, then choose the target EmpView. The
click adds and
associates

Deptno to Deptno to join. To display attributes choose your LOV display
attributes then choose what ever fields you want to show in the LOV dro
pdown list.
It is easy to add a new page, add a new page
forward to

Struts
-
config diagram and
name it. Lets create it for read only table for simple display purposes.

Drag the submit button
to the

page from

the component palette
. Edit
the buttons
propert
ies to

set the

name equal to

the event: we set it in
our struts
-
config diagram
prefixing the

event with

‘event’ (event_listall). Now run the emp
jsp again, this

time
click on our
new button and

you will

navigate to

the
newly created

summary page.



Now I

am going to compare the similarities and differences between JSP and
ASP. At first glance,
Java Server

Pages (JSP) and Microsoft Active Server Pages (ASP)
technologies have many similarities. Both are designed to create interactive pages as part
of a Web
-
based application. To a degree, both enable developers to separate
programming logic from page design through the use of components that are called from
the page itself. And both provide an alternative to creating CGI scripts that makes page
development an
d deployment easier and faster.

While
Java Server

Pages technology and Microsoft Active Server Pages are similar in
many ways, there are also a number of differences that exist. And these differences are

12

just as significant as the similarities, and have fa
r
-
reaching implications for the
developers who use them as well as the organizations that adopt them as part of their
overall Web
-
based
architecture.

JSP Technology: An Open Approach
:
In many ways, the biggest difference between JSP
and ASP technologies li
es in the approach to the software design itself. JSP technology is
designed to be both platform and server independent, created with input from a broader
community of tool, server, and database vendors. In contrast, ASP is a Microsoft
technology that reli
es primarily on Microsoft technologies.

Platform and Server Independence
:
JSP technology adheres to the Write Once, Run
Anywhere philosophy of the Java architecture. Instead of being tied to a single platform
or vendor, JSP technology can run on any Web s
erver and is supported by a wide variety
of tools from multiple vendors.

Because it uses ActiveX controls for its components, ASP technology is basically
restricted to Microsoft Windows
-
based platforms. Offered primarily as a feature of
Microsoft IIS, ASP
technology does not work easily on a broader range of Web servers
because ActiveX objects are platform specific.

Although ASP technology is available on other platforms through third
-
party porting
products, to access components and interact with other serv
ices, the ActiveX objects must
be present on the selected platform. If not present, a bridge to a platform supporting them
is required.

Open Development Process, Open Source
:
Sun developed JSP technology using the Java
Community Process. Since 1995, Sun h
as used this open process to develop and revise

13

Java technology and specifications in cooperation with the international Java community.
Working with Sun in the JSP effort are authoring tool vendors (such as Macromedia),
container companies (such as Apache

and Netscape), end users, consultants, and others.
Going forward, Sun is licensing the latest versions of JSP and Java Servlet (JSP 1.1 and
Java Servlet 2.2) source code to Apache to be developed and released under the Apache
development process. Apache,
Sun, and a number of other companies and individuals
will openly develop a robust reference implementation (RI) that is freely available to any
company or individual.

The JSP application programming interface (API) has undoubtedly benefited
-

and will
cont
inue to benefit
-

from the input of this extended community. In contrast, ASP
technology is a specifically Microsoft initiative, developed in a proprietary process.

ASP works on Microsoft IIS or personal web
server and

Microsoft windows plat form
whereas J
SP works on any web server, including Apache, Netscape and IIS. As far as
platforms are concerned it works on most popular platforms including the Solaris
Operating Environment, Microsoft windows, Mac OS, Linux, and other UNIX platform
implementations.


For a company selecting the components of
growing
, Web
-
based information
architecture, JSP technology provides a flexible, open choice that works with a wide
variety of vendors' tools and reflects industry input and collaboration.

Both ASP and JSP techn
ologies let developers separate content generation from layout by
accessing components from the page. ASP supports the COM model, while JSP
technology provides components based on
Java Beans
technology or JSP tags.


14

As noted previously, the differences outw
eigh the similarities.

Extensible JSP Tags
:
The first
difference apparent to any page author is

the JSP tags
themselves. While both ASP and JSP use a combination of tags and scripting to create
dynamic Web pages, JSP technology enables developers to extend

the JSP tags available.
JSP developers can create custom tag libraries, so page authors can access more
functionality using XML
-
like tags and depend less on scripting. With custom tags,
developers can shield page authors from the complexities of page crea
tion logic and
extend key functions to a broader range of authors.

Reusability
across

Platforms
:
Developers will also notice the focus on reusability. The
JSP components

Enterprise JavaBeans
, JavaBeans, or custom JSP tags are reusable
across platforms. An
Enterprise JavaBean component accessing legacy databases can
serve distributed systems on both UNIX and Microsoft Windows platforms. And the tag
extension capability of JSP technology gives developers an easy, XML
-
like interface for
sharing packaged functi
onality with page designers throughout the enterprise.

This component
-
based model speeds application development because it enables
developers to:



Build quick prototype applications using lightweight subcomponents, then
integrate additional functionality
as it becomes available



Leverage work done elsewhere in the organization and encapsulate it in a
JavaBean or Enterprise JavaBean component


15

The Java Advantage
:
JSP technology uses the Java language for scripting, while ASP
pages use Microsoft VBScript or JS
cript. The Java language is a mature, powerful, and
scalable programming language that provides many benefits over the Basic
-
based
scripting languages. For example, the Java language provides superior performance to the
interpreted VBScript or JScript lang
uages. Because they use Java technology and are
compiled into Java servlets, JSP pages provide a gateway to the entire suite of server
-
side
Java libraries for HTTP
-
aware applications.

The Java language makes the developer's job easier in other ways as well
. For example, it
helps protect against system crashes, while ASP applications on Windows NT systems
are susceptible to crashing. The Java language also helps in the area of memory
management by providing protection against memory leaks and hard
-
to
-
find po
inter bugs
that can slow application deployment. Plus, JSP provides the robust exception handling
necessary for real
-
world applications.

Easier Maintenance
:
Applications using JSP technology are easier to maintain over time
than ASP
-
based applications.

Sc
ripting languages are fine for small applications, but do not scale well to manage
large, complex applications. Because the Java language is structured, it is easier to
build and maintain large, modular applications with it.

JSP technology's emphasis on co
mponents over scripting makes it easier to revise
content without affecting logic, or revise logic without changing content.


16

The Enterprise JavaBeans architecture encapsulates the enterprise logic, such as
database access, security, and transaction integri
ty, and isolates it from the application
itself.

Because JSP technology is an open, cross
-
platform architecture, Web servers,
platforms, and other components can be easily upgraded or switched without
affecting JSP
-
based applications. This makes JSP suitab
le for real
-
world Web
applications, where constant change and growth is the norm.

Conclusion:
I have described the basic structure of world wide web and how it can be
connected to different DBMSs using different technologies. I have gone over the
salient
features of Oracle database and JDeveloper, and described how I am going to
implement my project using them. Then I have compared JSP and ASP technologies,
and shown that JSP is a far better technology than ASP.


References:

1.

Thomas Connolly & Carolyn Begg
, III Edition, 2002 .
Database
Systems, A Practical Approach to Design, Implementation, and
Management.

America :Addison Wesley
.

2.

Olivier Le Diouris,
2004
. Oracle
10G and
Application
Development Framework (ADF) Over
view
.


Proceedings of South
East Orac
le Users Conference
.
Charlotte, NC.


17

3.

World Wide Web (from
http://java.sun.com/products/jsp/jsp
-
asp.html
,



Sun Microsystems Inc.

July 4, 2004.

4.

Shaun O ‘Brien
, 2004
.
JDeveloper

10g web application
Development with ADF and Struts
.


Proceedings of South East
Oracle Users Conference
.
Charlotte, NC.