Professional Documents
Culture Documents
Server-side Java (SSJ), sometimes called servlets. Servlet technology is robust and scalable
because of java language. Server-side scripting languages are a type of programming language
that runs on the server instead of the client. They can create dynamic websites and web
applications, perform scheduling and data mining tasks, automate processes such as
compilation, and send emails.
It is the program that runs on server dealing with the generation of content of web
page.
1) Querying the database
2) Operations over databases
3) Access/Write a file on server.
4) Interact with other servers.
5) Structure web applications.
6) Process user input.
Today we all are aware of the need of creating dynamic web pages i.e the ones which have
the capability to change the site contents according to the time or are able to generate the
contents according to the request received by the client.
Servlets are the Java programs that run on the Java-enabled web server or application server.
They are used to handle the request obtained from the webserver, process the request,
produce the response, then send a response back to the webserver.
Properties of Servlets are as follows:
Servlets work on the server-side.
Servlets are capable of handling complex requests obtained from the webserver.
Servlet Architecture is can be depicted
There are many advantages of Servlet over CGI. The web container creates threads for handling
the multiple requests to the Servlet. Threads have many benefits over the Processes such as
they share a common memory area, lightweight, cost of communication between the threads
are low. The advantages of Servlet are as follows:
1. Better performance: because it creates a thread for each request, not process.
2. Portability: because it uses Java language.
3. Robust: JVM manages Servlets, so we don't need to worry about the memory
leak, garbage collection, etc.
4. Secure: because it uses java language.
A Java applet can communicate with other Java applets by using JavaScript functions in the
parent web page. JavaScript functions enable communication between applets by receiving
messages from one applet and invoking methods of other applets.
AppletContext class provides the facility of communication between applets. We provide the
name of applet through the HTML file. It provides getApplet() method that returns the object of
Applet
myapplet.html
<html>
<body>
<applet code="ButtonApplet.class" width="150" height="150" name="btn">
</applet>
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class ButtonApplet extends Applet implements ActionListener
{
Button btnColor;
The applet and servlet can use the same socket (or even several sockets) to communicate
interactively, sending messages back and forth.
HTML exhibits high performance by taking less time to load in the browser. However, when we
use HTML page for important user details, by default, all the parameters that are passed
appended in the URL. This compromises with the security. On the other hand, applet takes
more time to load but there is no problem with Java security. This is an advantage of this
technique.
We can use JDBC API to access tabular data stored in any relational database. By the help of
JDBC API, we can save, update, delete and fetch data from the database. It is like Open
Database Connectivity (ODBC) provided by Microsoft.
Advantage of JDBC-ODBC
o Easy to use.
o Can be easily connected to any database.
2. Native-API driver
The Native API driver uses the client-side libraries of the database. The driver converts
JDBC method calls into native calls of the database API. It is not written entirely in java.
Advantage:
o performance upgraded than JDBC-ODBC bridge driver.
The Network Protocol driver uses middleware (application server) that converts JDBC
calls directly or indirectly into the vendor-specific database protocol. It is fully written in java.
Advantage:
o No client side library is required because of application server that can perform many
tasks like auditing, load balancing, logging etc.
4. Thin driver
The thin driver converts JDBC calls directly into the vendor-specific database protocol.
That is why it is known as thin driver. It is fully written in Java language
Advantage:
o Better performance than all other drivers.
o No software is required at client side or server side.
Blob Clob
The full form of Blob is a Binary Large The full form of Clob is Character Large
Object. Object.
This is used to store large binary data. This is used to store large textual data.
This stores values in the form of binary This stores values in the form of character
streams. streams.
Using this you can stores files like Using this you can store files like text files,
videos, images, gifs, and audio files. PDF documents, word documents etc.
MySQL supports this with the following MySQL supports this with the following
datatypes: datatypes:
TINYBLOB TINYTEXT
BLOB TEXT
MEDIUMBLOB MEDIUMTEXT
LONGBLOB LONGTEXT
The Blob object in JDBC points to the The Blob object in JDBC points to the
location of BLOB instead of holding its location of BLOB instead of holding its
binary data. character data.
The Java Media Framework API (JMF) enables audio, video and other time-based media to be
added to applications and applets built on Java technology. JavaFX is a set of graphics and
media packages that enables developers to design, create, test, debug, and deploy rich client
applications that operate consistently across diverse platforms.
What Is JMF?
JMF is a framework for handling streaming media in Java programs. JMF is an optional package
of Java 2 standard platform. JMF provides a unified architecture and messaging protocol for
managing the acquisition, processing and delivery of time-based media. JMF enables Java
programs to
(i) Present ( playback) multimedia contents,
(ii) capture audio through microphone and video through Camera,
(iii) do real-time streaming of media over the Internet,
(iv) process media ( such as changing media format, adding special effects),
(v) store media into a file.
Applications of JMF
Teleconferencing
Multimedia editing/sequencing
Streaming multimedia web content
Software applications are becoming more and more distributed. Java has emerged as an ideal
programming language for developing Internet applications.
Some of the promising multimedia applications that are deployable over the Internet include
(i) video conferencing,
(ii) media-on-demand,
(iii) access to multimedia database over Internet,
(iv) interactive distance education,
(v) collaborative computing,
(vi) virtual reality based scene navigation,
vii) interactive games rich in 3D graphics, etc
One of JMF's important design considerations is to support standard protocols. JMF provides
these functionalities by working on top of RTP and RTCP.
The architecture of JMF is shown in Figure 1.3. One obvious feature of the architecture is that it
contains some native components that talk directly to hardware. These components include the
codecs, capturers and renderers. They are responsible for the capturing, coding/decoding and
playback of media data. These tasks are intimately related to the hardware, so a native
approach can help to boost performance and get around security issues, because Java code is
not allowed to have direct control over the hardware of the host operating system. Apart from
these exceptions, the core of JMF is implemented in pure Java.
The hardware dependency of JMF creates an inconvenience for JMF applications, however. JMF
must be installed on any client machine that runs these applications. This is one reason why
JMF has not been very successful so far.
JMF components are designed after the model of media playback as shown in Figure. This
model is familiar to us because it is very similar to the way common electronic devices are
connected together - and how they have been for quite a long time. In this fundamental model,
a video camera represents a capture device; the media data (a video tape, for example) is
encapsulated as a data source; and the VCR, as a player, controls the playback of media data.
Finally, during playback, the data is rendered on destination devices such as loudspeakers and a
television.