Professional Documents
Culture Documents
J2EE
We hope that the project will find greater appreciation among different readers and
teachers about its usefulness. It would be my sane opportunity to know if any
mistakes have crept in to the script.
Acknowledgement
I acknowledge my gratitude and thank to all the well knowledge persons for giving
me opportunity to avail all the best facilities available at this networking institute
through which I have gained knowledge thinking so as too just in the environment
suitable for harmonic adjustment. I am grateful to the following person for various
Last but not the least; I thank my teacher, friends and my family members for their
constant encouragement.
Table of Contents
Preface
Acknowledgement
Table of Contents
1. Programming languages.
2. Introduction to java.
3. J2EE
3.1.Servlets
4.
5.
6.
7.
3.1.1. HttpServletRequests
3.1.2. HttpServletResponse
3.1.3. HttpSessions
3.1.4. HttpCookies
3.2.Java Beans
3.3.JSP
DBMS
4.1.MySql
Ajax
Javascript
Bibliography
1. Programming languages
possibly control external devices such as printers, disk drives, robots, and so on. A
programming language is an artificial language designed to express computations
that can be performed by a machine, particularly a computer. Programming
languages can be used to create programs that control the behavior of a machine
and/or to express algorithms precisely.
The earliest programming languages predate the invention of the computer, and
were used to direct the behavior of machines such as Jacquard looms and player
pianos. Thousands of different programming languages have been created, mainly
in the computer field, with many more being created every year. Most
programming languages describe computation in an imperative style, i.e., as a
sequence of commands, although some languages, such as those that support
functional programming or logic programming, use alternative forms of
description.
Computer programming languages are mainly categorized into1. Procedural Programming language.
2. Object Oriented Programming language.
Procedural programming can sometimes be used as a synonym for imperative
programming (specifying the steps the program must take to reach the desired
state), but can also refer (as in this article) to a programming paradigm, derived
from structured programming, based upon the concept of the procedure call.
Procedures, also known as routines, subroutines, methods, or functions (not to be
confused with mathematical functions, but similar to those used in functional
programming) simply contain a series of computational steps to be carried out. Any
given procedure might be called at any point during a program's execution,
including by other procedures or itself.
2. Introduction to Java
Java is a programming language originally developed by James Gosling at Sun
Microsystems (which is now a subsidiary of Oracle Corporation) and released in
1995 as a core component of Sun Microsystems' Java platform. The language
derives much of its syntax from C and C++ but has a simpler object model and
A Java Virtual Machine is a piece of software that is implemented on nonvirtual hardware and on standard operating systems. A JVM provides an
environment in which Java bytecode can be executed, enabling such features as
automated exception handling, which provides "root-cause" debugging
information for every software error (exception), independent of the source
code. A JVM is distributed along with a set of standard class libraries that
implement the Java application programming interface (API). Appropriate APIs
bundled together form the Java Runtime Environment (JRE).The Java
Development Kit (JDK) is a Sun Microsystems product aimed at Java
developers. Since the introduction of Java, it has been by far the most widely
used Java SDK.
3. J2EE
Java Platform, Enterprise Edition or Java EE is a widely used platform for
server programming in the Java programming language. The Java platform
(Enterprise Edition) differs from the Java Standard Edition Platform (Java SE) in
that it adds libraries which provide functionality to deploy fault-tolerant,
distributed, multi-tier Java software, based largely on modular components running
on an application server.
extend the applications hosted by Web servers. Thus, it can be thought of as a Java
Applet that runs on a server instead of a browser.[1]
A Servlet is a Java class in Java EE that conforms to the Java Servlet API, a
protocol by which a Java class may respond to requests. They are not tied to a
specific client-server protocol, but are most often used with the HTTP protocol.
Therefore, the word "Servlet" is often used in the meaning of "HTTP Servlet".[2]
Thus, a software developer may use a servlet to add dynamic content to a Web
server using the Java platform. The generated content is commonly HTML, but
may be other data such as XML. Servlets are the Java counterpart to non-Java
dynamic Web content technologies such as CGI and ASP.NET. Servlets can
maintain state in session variables across many server transactions by using HTTP
cookies, or URL rewriting.
To deploy and run, the Apache Tomcat Server may be used. It is an open
source servlet container developed by the Apache Software Foundation (ASF).
Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications
from Sun Microsystems, and provides a "pure Java" HTTP web server
environment for Java code to run.
Life cycle of a servlet
1. The container calls the no-arg constructor.
2. The Web container calls the init() method. This method
initializes the servlet and must be called before life of a
servlet, the init() method is called only once.
3. After initialization, the servlet can service client requests.
Each request is serviced in its own separate thread. The Web
container calls the service() method of the servlet for
every request. The service() method determines the kind
of request being made and dispatches it to an appropriate
method to handle the request. The developer of the servlet
must provide an implementation for these methods. If a
request for a method that is not implemented by the servlet
Description
Enables servlets to read data from an Http
request. Enables servlets to write data to
an Http response. Allows session data to
be read and written.
The following table summarizes the core classes that are provided
in this package. The most important of these is HttpServlet.
Servlet developers typically extend this class in order to process
Http Requests.
Description
Class
1. Cookie
2. HttpServle
t
3. HttpSessio
nEvent
3.1.1 HttpServletRequests
The HttpServletRequest interface is implemented by the server. It enables a servlet
to obtain information about a client request. Extends the ServletRequest interface
to provide request information for HTTP servlets. The servlet container creates an
HttpServletRequest object and passes it as an argument to the servlet's service
methods (doGet, doPost, etc).
Method Summary
java.lang.String - getAuthType()
Returns the name of the authentication scheme used to protect the servlet.
java.lang.String - getContextPath()
Returns the portion of the request URI that indicates the context of the
request.
Cookie[] getCookies()
Returns an array containing all of the Cookie objects the client sent with this
request.
long getDateHeader(java.lang.String name)
Returns the value of the specified request header as a long value that
represents a Date object.
java.lang.String getHeader(java.lang.String name)
Returns the value of the specified request header as a String.
java.util.Enumeration getHeaderNames()
Returns an enumeration of all the header names this request contains.
java.lang.String getServletPath()
Returns the part of this request's URL that calls the servlet.
HttpSession getSession()
Returns the current session associated with this request, or if the request does
not have a session, creates one.
HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request or, if if there is
no current session and create is true, returns a new session.
java.security.Principal getUserPrincipal()
Returns a java.security.Principal object containing the name of the current
authenticated user.
boolean isRequestedSessionIdFromCookie()
Checks whether the requested session ID came in as a cookie.
boolean isRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use
isRequestedSessionIdFromURL()instead.
Boolean isRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL.
boolean isRequestedSessionIdValid()
Checks whether the requested session ID is still valid.
Boolean isUserInRole java.lang.String role)
Returns a boolean indicating whether the authenticated user is included in
the specified logical "role".
3.1.2 HttpServletResponse
public interface HttpServletResponse
extends ServletResponse
Extends the ServletResponse interface to provide HTTP-specific
functionality in sending a response. For example, it has methods to access
HTTP headers and cookies. The servlet container creates an
HttpServletResponse object and passes it as an argument to the servlet's
service methods (doGet, doPost, etc).
The HttpServletResponse interface is implemented by the server. It enables a
servlet to formulate an HTTP response to a client. Several constants are
defined. These correspond to the different status codes that can be assigned
to an HTTP response. For example, SC_OK indicates that the HTTP request
succeeded and SC_NOT_FOUND indicates that the requested resource is
not available.
Field Summary
static in SC_ACCEPTED
t
Status code (202) indicating that a request was accepted for
processing, but was not completed.
static in SC_BAD_GATEWAY
t
Status code (502) indicating that the HTTP server received an
invalid response from a server it consulted when acting as a proxy or
gateway.
static in SC_BAD_REQUEST
t
Status code (400) indicating the request sent by the client was
syntactically incorrect.
static in SC_CONFLICT
t
Status code (409) indicating that the request could not be
completed due to a conflict with the current state of the resource.
static in SC_CONTINUE
t
Status code (100) indicating the client can continue.
static in SC_CREATED
t
Status code (201) indicating the request succeeded and created a
new resource on the server.
static in SC_EXPECTATION_FAILED
t
Status code (417) indicating that the server could not meet the
expectation given in the Expect request header.
static in SC_FORBIDDEN
t
Status code (403) indicating the server understood the request but
refused to fulfill it.
static in SC_FOUND
t
Status code (302) indicating that the resource reside temporarily
under a different URI.
static in SC_GATEWAY_TIMEOUT
t
Status code (504) indicating that the server did not receive a
timely response from the upstream server while acting as a gateway or
proxy.
static in SC_GONE
t
Status code (410) indicating that the resource is no longer
available at the server and no forwarding address is known.
static in SC_HTTP_VERSION_NOT_SUPPORTED
t
Status code (505) indicating that the server does not support or
refuses to support the HTTP protocol version that was used in the
request message.
static in SC_INTERNAL_SERVER_ERROR
t
Status code (500) indicating an error inside the HTTP server
which prevented it from fulfilling the request.
static in SC_LENGTH_REQUIRED
t
Status code (411) indicating that the request cannot be handled
static in SC_NOT_FOUND
t
Status code (404) indicating that the requested resource is not
available.
static in SC_NOT_IMPLEMENTED
t
Status code (501) indicating the HTTP server does not support the
functionality needed to fulfill the request.
static in SC_NOT_MODIFIED
t
Status code (304) indicating that a conditional GET operation
found that the resource was available and not modified.
static in SC_OK
t
Status code (200) indicating the request succeeded normally.
static in SC_PARTIAL_CONTENT
t
Status code (206) indicating that the server has fulfilled the partial
GET request for the resource.
static in SC_PAYMENT_REQUIRED
t
Status code (402) reserved for future use.
static in SC_PRECONDITION_FAILED
t
Status code (412) indicating that the precondition given in one or
more of the request-header fields evaluated to false when it was tested
on the server.
static in SC_PROXY_AUTHENTICATION_REQUIRED
t
Status code (407) indicating that the client MUST first
authenticate itself with the proxy.
static in SC_REQUEST_ENTITY_TOO_LARGE
t
Status code (413) indicating that the server is refusing to process
the request because the request entity is larger than the server is willing
or able to process.
static in SC_REQUEST_TIMEOUT
t
Status code (408) indicating that the client did not produce a
request within the time that the server was prepared to wait.
static in SC_REQUEST_URI_TOO_LONG
t
Status code (414) indicating that the server is refusing to service
the request because the Request-URI is longer than the server is willing
to interpret.
static in SC_REQUESTED_RANGE_NOT_SATISFIABLE
t
Status code (416) indicating that the server cannot serve the
requested byte range.
static in SC_RESET_CONTENT
t
Status code (205) indicating that the agent SHOULD reset the
document view which caused the request to be sent.
static in SC_SEE_OTHER
t
Status code (303) indicating that the response to the request can be
found under a different URI.
static in SC_SERVICE_UNAVAILABLE
t
Status code (503) indicating that the HTTP server is temporarily
overloaded, and unable to handle the request.
static in SC_SWITCHING_PROTOCOLS
t
Status code (101) indicating the server is switching protocols
according to Upgrade header.
static in SC_TEMPORARY_REDIRECT
t
Status code (307) indicating that the requested resource resides
temporarily under a different URI.
static in SC_UNAUTHORIZED
t
Status code (401) indicating that the request requires HTTP
authentication.
static in SC_UNSUPPORTED_MEDIA_TYPE
t
Status code (415) indicating that the server is refusing to service
the request because the entity of the request is in a format not supported
by the requested resource for the requested method.
static in SC_USE_PROXY
t
Status code (305) indicating that the requested resource MUST be
accessed through the proxy given by the Location field.
Method Summary
void addCookie(Cookie cookie)
Adds the specified cookie to the
response.
void addDateHeader(java.lang.String name,
long date)
Adds a response header with the
given name and date-value.
void addHeader(java.lang.String name,
java.lang.String value)
Adds a response header with the
given name and value.
void addIntHeader(java.lang.String name,
int value)
Adds a response header with the
given name and integer value.
boolean containsHeader(java.lang.String name)
Returns a boolean indicating whether
response.
void sendError(int sc)
Sends an error response to the client
using the specified status code and clears
the buffer.
void sendError(int sc, java.lang.String msg)
Sends an error response to the client
using the specified status and clears the
buffer.
void sendRedirect(java.lang.String location)
Sends a temporary redirect response
to the client using the specified redirect
location URL and clears the buffer.
void setDateHeader(java.lang.String name,
long date)
Sets a response header with the given
name and date-value.
void setHeader(java.lang.String name,
java.lang.String value)
Sets a response header with the given
name and value.
void setIntHeader(java.lang.String name,
int value)
Sets a response header with the given
name and integer value.
void setStatus(int sc)
Sets the status code for this response.
void setStatus(int sc, java.lang.String sm)
3.1.3
HTTPSession
javax.servlet.http
Interface HttpSession
public interface HttpSession
Provides a way to identify a user across more than one page request or visit to a
Web site and to store information about that user.
The servlet container uses this interface to create a session between an HTTP client
and an HTTP server. The session persists for a specified time period, across more
than one connection or page request from the user. A session usually corresponds
to one user, who may visit a site many times. The server can maintain a session in
many ways such as using cookies or rewriting URLs.
This interface allows servlets to
View and manipulate information about a session, such as the session
identifier, creation time, and last accessed time
Bind objects to sessions, allowing user information to persist across multiple
user connections
Method Summary.
getCreationTime
public long getCreationTime()
Returns the time when this session was created, measured in milliseconds
since midnight January 1, 1970 GMT.
Returns:
a long specifying when this session was created, expressed in milliseconds
since 1/1/1970 GMT
Throws:
java.lang.IllegalStateException - if this method is called on an invalidated
session
getId
public java.lang.String getId()
Returns a string containing the unique identifier assigned to this session. The
identifier is assigned by the servlet container and is implementation
dependent.
Returns:
a string specifying the identifier assigned to this session
getLastAccessedTime
public long getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as
the number of milliseconds since midnight January 1, 1970 GMT.
Actions that your application takes, such as getting or setting a value
associated with the session, do not affect the access time.
Returns:
a long representing the last time the client sent a request associated with this
session, expressed in milliseconds since 1/1/1970 GMT
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests before the servlet
container will invalidate this session. A negative time indicates the session
should never timeout.
Parameters:
interval - An integer specifying the number of seconds
getMaxInactiveInterval
public int getMaxInactiveInterval()
Returns the maximum time interval, in seconds, that the servlet container
will keep this session open between client accesses. After this interval, the
servlet container will invalidate the session. The maximum time interval can
be set with the setMaxInactiveInterval method. A negative time indicates the
session should never timeout.
Returns:
an integer specifying the number of seconds this session remains open
between client requests
See Also:
setmaxInactiveInterval(int)
getSessionContext
public HttpSessionContext getSessionContext()
Deprecated. As of Version 2.1, this method is deprecated and has no
replacement. It will be removed in a future version of the Java Servlet API.
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session, or null if
no object is bound under the name.
Parameters:
name - a string specifying the name of the object
Returns:
the object with the specified name
Throws:
java.lang.IllegalStateException - if this method is called on an invalidated
session
getValue
public java.lang.Object getValue(java.lang.String name)
Deprecated. As of Version 2.2, this method is replaced by
getAttribute(java.lang.String).
Parameters:
name - a string specifying the name of the object
Returns:
the object with the specified name
Throws:
java.lang.IllegalStateException - if this method is called on an invalidated
session
getAttributeNames
public java.util.Enumeration getAttributeNames()
Returns an Enumeration of String objects containing the names of all the
objects bound to this session.
Returns:
an Enumeration of String objects specifying the names of all the objects
bound to this session
Throws:
java.lang.IllegalStateException - if this method is called on an invalidated
session
getValueNames
public java.lang.String[] getValueNames()
setAttribute
public void setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this session, using the name specified. If an object of the
same name is already bound to the session, the object is replaced.
After this method executes, and if the object implements
HttpSessionBindingListener, the container calls
HttpSessionBindingListener.valueBound.
Parameters:
name - the name to which the object is bound; cannot be null
value - the object to be bound; cannot be null
Throws:
java.lang.IllegalStateException - if this method is called on an invalidated
session
putValue
public void putValue(java.lang.String name,
java.lang.Object value)
removeAttribute
public void removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session. If the
session does not have an object bound with the specified name, this method
does nothing.
After this method executes, and if the object implements
HttpSessionBindingListener, the container calls
HttpSessionBindingListener.valueUnbound.
Parameters:
name - the name of the object to remove from this session
Throws:
java.lang.IllegalStateException - if this method is called on an invalidated
session
removeValue
public void removeValue(java.lang.String name)
invalidate
public void invalidate()
Invalidates this session and unbinds any objects bound to it.
Throws:
java.lang.IllegalStateException - if this method is called on an already
invalidated session
isNew
public boolean isNew()
Returns true if the client does not yet know about the session or if the client
chooses not to join the session. For example, if the server used only cookiebased sessions, and the client had disabled the use of cookies, then a session
would be new on each request.
Returns:
true if the server has created a session, but the client has not yet joined
Throws:
java.lang.IllegalStateException - if this method is called on an already
invalidated session.
3.1.4 Cookies
A cookie, also known as an HTTP cookie, web cookie, or browser cookie,
is used for an origin website to send state information to a user's browser and
for the browser to return the state information to the origin site. The state
information can be used for authentication, identification of a user session,
user's preferences, shopping cart contents, or anything else that can be
accomplished through storing text data.
Cookies are not software. They cannot be programmed, cannot carry viruses,
and cannot install malware on the host computer . However, they can be
used by spyware to track user's browsing activities a major privacy
concern that prompted European and US law makers to take actions.
Cookies could also be stolen by hackers to gain access to a victim's web
account.
java.net
Class HttpCookie
java.lang.Object
java.net.HttpCookie
All Implemented Interfaces:
Cloneable
An HttpCookie object represents an http cookie, which carries state information between server
and user agent. Cookie is widely adopted to create stateful sessions.
Method Summary
Object clone()
Create and return a copy of this object.
static boolean domainMatches(String domain, String host)
The utility method to check whether a host name is
in a domain or not.
boolean equals(Object obj)
Test the equality of two http cookies.
String getComment()
Returns the comment describing the purpose of
this cookie, or null if the cookie has no comment.
String getCommentURL()
Returns the comment url describing the purpose of
this cookie, or null if the cookie has no comment url.
boolean getDiscard()
Return the discard attribute of the cookie
String getDomain()
Returns the domain name set for this cookie.
long getMaxAge()
Returns the maximum age of the cookie, specified
in seconds.
String getName()
Returns the name of the cookie.
String getPath()
Returns the path on the server to which the
browser returns this cookie.
String getPortlist()
Return the port list attribute of the cookie
boolean getSecure()
Returns true if sending this cookie should be
restricted to a secure protocol, or false if the it can be
JavaServer Pages (JSP) is a Java technology that helps software developers serve
dynamically generated web pages based on HTML, XML, or other document
types. Released in 1999 as Sun's answer to ASP and PHP, JSP was designed to
address the perception that the Java programming environment didn't provide
developers with enough support for the Web.
To deploy and run, a compatible web server with servlet container is required. The
Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems
and the JCP must both be met by the container.
Architecturally, JSP may be viewed as a high-level abstraction of Java servlets. JSP
pages are loaded in the server and are operated from a structured special installed
Java server packet called a Java EE Web Application, often packaged as a .war or
.ear file archive.
JSP allows Java code and certain pre-defined actions to be interleaved with static
web markup content, with the resulting page being compiled and executed on the
server to deliver an HTML or XML document. The compiled pages and any
dependent Java libraries use Java bytecode rather than a native software format,
and must therefore be executed within a Java virtual machine (JVM) that integrates
with the host operating system to provide an abstract platform-neutral
environment.
JSP syntax is a fluid mix of two basic content forms: scriptlet elements and
markup. Markup is typically standard HTML or XML, while scriptlet elements are
delimited blocks of Java code which may be intermixed with the markup. When
the page is requested the Java code is executed and its output is added, in situ, with
the surrounding markup to create the final page. JSP pages must be compiled to
Java bytecode classes before they can be executed, but such compilation is needed
only when a change to the source JSP file has occurred.
Java code is not required to be complete (self contained) within its scriptlet
element block, but can straddle markup content providing the page as a whole is
syntactically correct (for example, any Java if/for/while blocks opened in one
scriptlet element must be correctly closed in a later element for the page to
successfully compile). This system of split inline coding sections is called step
over scripting because it can wrap around the static markup by stepping over it.
Markup which falls inside a split block of code is subject to that code, so markup
inside an if block will only appear in the output when the if condition evaluates to
true; likewise markup inside a loop construct may appear multiple times in the
output depending upon how many times the loop body runs.
The JSP syntax adds additional XML-like tags, called JSP actions, to invoke builtin functionality. Additionally, the technology allows for the creation of JSP tag
libraries that act as extensions to the standard HTML or XML tags. JVM operated
tag libraries provide a platform independent way of extending the capabilities of a
web server. Note that not all commercial Java servers are Java EE specification
compliant.
JavaServer Pages (JSP) is a technology based on the Java language and enables the
development of dynamic web sites. JSP was developed by Sun Microsystems to
allow server side development. JSP files are HTML files with special Tags
containing Java source code that provide the dynamic content.The following shows
the Typical Web server,different clients connecting via the Internet to a Web server.
In this example,the Web server is running on Unix and is the very popular Apache
Web server.
First static web pages were displayed. Typically these were people?s first
experience with making web pages so consisted of My Home Page sites and
company marketing information. Afterwards Perl and C were languages used on
the web server to provide dynamic content. Soon most languages including
Visualbasic,Delphi,C and Java could be used to write applications that provided
dynamic content using data from text files or database requests. These were known
as CGI server side applications. ASP was developed by Microsoft to allow HTML
developers to easily provide dynamic content supported as standard by Microsoft?s
free Web Server,Internet Information Server (IIS). JSP is the equivalent from Sun
Microsystems,a comparison of ASP and JSP will be presented in the following
section.
The following diagram shows a web server that supports JSP files. Notice that the
web server also is connected to a database.
JSP is easy to learn and allows developers to quickly produce web sites and
applications in an open and standard way. JSP is based on Java,an object-oriented
language. JSP offers a robust platform for web development.
This means you are never locked into one vendor or platform. HTML and graphics
displayed on the web browser are classed as the presentation layer. The Java code
(JSP) on the server is classed as the implementation. By having a separation of
presentation and implementation,web designers work only on the presentation and
Java developers concentrate on implementing the application.
JSP architecture
JSPs are built on top of SUN Microsystems' servlet technology. JSPs are essential
an HTML page with special JSP tags embedded. These JSP tags can contain Java
code. The JSP file extension is .jsp rather than .htm or .html. The JSP engine parses
the .jsp and creates a Java servlet source file. It then compiles the source file into a
class file,this is done the first time and this why the JSP is probably slower the first
time it is accessed. Any time after this the special compiled servlet is executed and
is therefore returns faster.
4. DBMS
A Database Management System (DBMS) is a software package with
computer programs that control the creation, maintenance, and the use of a
database. It allows organizations to conveniently develop databases for various
applications by database administrators (DBAs) and other specialists. A database is
an integrated collection of data records, files, and other database objects. A DBMS
allows different user application programs to concurrently access the same
database.
DBMSs may use a variety of database models, such as the relational model or
object model, to conveniently describe and support applications. It typically
supports query languages, which are in fact high-level programming languages,
dedicated database languages that considerably simplify writing database
application programs. Database languages also simplify the database organization
as well as retrieving and presenting information from it. A DBMS provides
facilities for controlling data access, enforcing data integrity, managing
concurrency control, recovering the database after failures and restoring it from
backup files, as well as maintaining database security.
A DBMS is a set of software programs that controls the system organization,
storage, management, and retrieval of data in a database. DBMSs are categorized
according to their data structures or types. The DBMS accepts requests for data
from an application program and instructs the operating system to transfer the
appropriate data. The queries and responses must be submitted and received
according to a format that conforms to one or more applicable protocols. When a
DBMS is used, information systems can be changed more easily as the
In Sweden, Codd's paper was also read and Mimer SQL was developed from the
mid-70s at Uppsala University. In 1984, this project was consolidated into an
independent enterprise. In the early 1980s, Mimer in c introduced transaction
handling for high robustness in applications, an idea that was subsequently
implemented on most other DBMS.
Components DBMS Engine accepts logical requests from various other DBMS
subsystems, converts them into physical equivalents, and actually accesses
the database and data dictionary as they exist on a storage device.
Data Definition Subsystem helps the user create and maintain the data
dictionary and define the structure of the files in a database.
Data Manipulation Subsystem helps the user to add, change, and delete
information in a database and query it for valuable information. Software
tools within the data manipulation subsystem are most often the primary
interface between user and the information contained in a database. It allows
the user to specify its logical information requirements.
Application Generation Subsystem contains facilities to help users
develop transaction-intensive applications. It usually requires that the user
perform a detailed series of tasks to process a transaction. It facilitates easyto-use data entry screens, programming languages, and interfaces.
Modeling language
A modeling language is a data modeling language to define the schema of each
database hosted in the DBMS, according to the DBMS database model. Database
management systems (DBMS) are designed to use one of five database structures
model is not easy for the end user to run queries with because it may require a
complex combination of many tables.
The multidimensional structure is similar to the relational model. The
dimensions of the cube-like model have data relating to elements in each cell. This
structure gives a spreadsheet-like view of data. This structure is easy to maintain
because records are stored as fundamental attributes - in the same way they are
viewed - and the structure is easy to understand. Its high performance has made it
the most popular database structure when it comes to enabling online analytical
processing (OLAP).
The object oriented structure has the ability to handle graphics, pictures, voice
and text, types of data, without difficultly unlike the other database structures. This
structure is popular for multimedia Web-based applications. It was designed to
work with object-oriented programming languages such as Java.
The dominant model in use today is the ad hoc one embedded in SQL,despite the
objections of purists who believe this model is a corruption of the relational model
since it violates several fundamental principles for the sake of practicality and
performance. Many DBMSs also support the Open Database Connectivity API that
supports a standard way for programmers to access the DBMS.
Before the database management approach, organizations relied on file processing
systems to organize, store, and process data files. End users criticized file
processing because the data is stored in many different files and each organized in
a different way. Each file was specialized to be used with a specific application.
File processing was bulky, costly and nonflexible when it came to supplying
needed data accurately and promptly. Data redundancy is an issue with the file
processing system because the independent data files produce duplicate data so
when updates were needed each separate file would need to be updated. Another
issue is the lack of data integration. The data is dependent on other data to organize
and store it. Lastly, there was not any consistency or standardization of the data in
a file processing system which makes maintenance difficult. For these reasons, the
database management approach was produced.
Data structure
Data structures (fields, records, files and objects) optimized to deal with very large
amounts of data stored on a permanent data storage device (which implies
relatively slow access compared to volatile main memory).
4.1 SQL
SQL , often referred to as Structured Query Language, is a database
computer declarative language designed for managing data in relational
database management systems (RDBMS), and originally based upon
relational algebra and tuple relational calculus. Its scope includes data insert,
query, update and delete, schema creation and modification, and data access
control. SQL was one of the first commercial languages for Edgar F. Codd's
relational model, as described in his influential 1970 paper, "A Relational
Model of Data for Large Shared Data Banks".Despite not adhering to the
relational model as described by Codd, it became the most widely used
database language.
The SQL language is sub-divided into several language elements, including:
Clauses, which are constituent components of statements
and queries. (In some cases, these are optional.)
Expressions, which can produce either scalar values or
tables consisting of columns and rows of data.
Predicates, which specify conditions that can be evaluated
to SQL three-valued logic (3VL) or Boolean
(true/false/unknown) truth values and which are used to limit
the effects of statements and queries, or to change program
flow.
Queries, which retrieve the data based on specific criteria.
This is the most important element of SQL.
Statements, which may have a persistent effect on
schemata and data, or which may control transactions,
program flow, connections, sessions, or diagnostics.
5. Ajax
Partial submit: An HTML page can submit form data as needed without
requiring a full page refresh.
Mashups: An HTML page can obtain data using a server-side proxy or by
including an external script to mix external data with your application's or
your service's data. For example, you can mix content or data from a thirdparty application such as Google Maps with your own application.
Page as an application: Ajax techniques can be made to create single-page
applications that look and feel much like a desktop application. See the
article on the use of Ajax and portlets for more on how you can use portlet
applications today.
Though not all-inclusive, this list shows that Ajax interactions allow web
applications to do much more than they have done in the past.
How Ajax is Different
An Ajax application eliminates the start-stop-start-stop nature of interaction on the
Web by introducing an intermediaryan Ajax enginebetween the user and the
server. It seems like adding a layer to the application would make it less
responsive, but the opposite is true.
Instead of loading a webpage, at the start of the session, the browser loads an Ajax
enginewritten in JavaScript and usually tucked away in a hidden frame. This
engine is responsible for both rendering the interface the user sees and
communicating with the server on the users behalf. The Ajax engine allows the
users interaction with the application to happen asynchronouslyindependent of
communication with the server. So the user is never staring at a blank browser
window and an hourglass icon, waiting around for the server to do something.
doesnt require a trip back to the serversuch as simple data validation, editing
data in memory, and even some navigationthe engine handles on its own. If the
engine needs something from the server in order to respondif its submitting data
for processing, loading additional interface code, or retrieving new datathe
engine makes those requests asynchronously, usually using XML, without stalling
a users interaction with the application.
6. Javascript
JavaScript, also known as ECMAScript, is a prototype-based,
object-oriented scripting language that is dynamic, weakly typed and has first-class
functions. It is also considered a functional programming.
JavaScript is an implementation of the ECMAScript language
standard and is primarily used in the form of client-side JavaScript, implemented
as part of a web browser in order to provide enhanced user interfaces and dynamic
websites. This enables programmatic access to computational objects within a host
environment.JavaScript's use in applications outside web pagesfor example in
PDF documents, site-specific browsers and desktop widgetsis also significant.
Newer and faster JavaScript VMs and frameworks built upon them (notably
Node.js) have also increased the popularity of JavaScript for server-side web
apps.JavaScript uses syntax influenced by that of C. JavaScript copies many names
and naming conventions from Java, but the two languages are otherwise unrelated
and have very different semantics.
FeaturesThe following features are common to all conforming ECMAScript
implementations, unless explicitly specified otherwise.
Imperative and structured
JavaScript supports structured programming syntax in C (e.g., if statements,
while loops, switch statements, etc.). One partial exception is scoping: C-style
block-level scoping is not supported (instead, JavaScript has function-level
scoping). JavaScript 1.7, however, supports block-level scoping with the let
keyword. Like C, JavaScript makes a distinction between expressions and
statements. One syntactic difference from C is automatic semicolon insertion, in
which the semicolons that terminate statements can be omitted.
Dynamic
Dynamic typing
As in most scripting languages, types are associated with
values, not with variables. For example, a variable x could be
bound to a number, then later rebound to a string. JavaScript
supports various ways to test the type of an object, including
duck typing.
Object based
JavaScript is almost entirely object-based. JavaScript objects
are associative arrays, augmented with prototypes (see
below). Object property names are string keys: obj.x = 10
and obj['x'] = 10 are equivalent, the dot notation being
syntactic sugar. Properties and their values can be added,
changed, or deleted at run-time. Most properties of an object
(and those on its prototype inheritance chain) can be
enumerated using a for...in loop. JavaScript has a small
number of built-in objects such as Function and Date.
Run-time evaluation
JavaScript includes an eval function that can execute
statements provided as strings at run-time.
Functional
First-class functions
Functions are first-class; they are objects themselves. As
such, they have properties and methods, such as length and