In Java, a thread always exists in any one of the following states. These
Blocked / Waiting
• New: Whenever a new thread is created, it is always in the new state.
For a thread in the new state, the code has not been run yet and thus
has not begun its execution.
• Active: When a thread invokes the start() method, it moves from the
new state to the active state. The active state contains two states
within it: one is runnable, and the other is running.
• Blocked or Waiting: Whenever a thread is inactive for a span of time
(not permanently) then, either the thread is in the blocked state or is
in the waiting state.
• Timed Waiting: Sometimes, waiting for leads to starvation.
• Terminated: A thread reaches the termination state because of the
• When a thread has finished its job, then it exists or terminates normally.
• Abnormal termination: It occurs when some unusual events such as an
unhandled exception or segmentation fault.
The following are the important differences between
Applets and Servlets.
Sr. No. Key Applets Servlets
Execution Applets are executed on client-side i.e applet runs within a Web
browser on the client machine.
Servlets on other hand executed on the server-side i.e servlet runs on
the web Page on server.
Parent packages Parent package of Applet includes java.applet.* and java.awt.* Parent package of Servlet includes javax.servlet.* and
Methods Important methods of applet includes init(), stop(), paint(), start(),
Lifecycle methods of servlet are init( ), service( ), and destroy( ).
User interface For the execution of the applet, a user interface is required such as
AWT or swing.
No such interface is required for the execution of servlet.
Required Bandwidth The applet requires user interface on the client machine for execution
so it requires more bandwidth.
On the other hand, Servlets are executed on the servers and hence
require less bandwidth.
Secure Applets are more prone to risk as execution is on the client machine. Servlets are more secure as execution is under server security.
Java Swing and Abstract Windowing Toolkit
• Why AWT is platform independent?
• Java AWT calls the native platform calls the native platform (operating
systems) subroutine for creating API components like TextField, ChechBox,
• an AWT application will look like a windows application in Windows OS
whereas it will look like a Mac application in the MAC OS.
There are four types of containers in Java AWT:
• The window is the container that have no borders and menu bars. You must use
frame, dialog or another window for creating a window. We need to create an
instance of Window class to create this container.
• The Panel is the container that doesn't contain title bar, border or menu bar. It is
generic container for holding the components. It can have other components like
button, text field etc. An instance of Panel class creates a container, in which we can
• The Frame is the container that contain title bar and border and can have menu bars.
It can have other components like button, text field, scrollbar etc. Frame is most
widely used container while developing an AWT application.
• Java Networking is a concept of connecting two or more computing devices
together so that we can share resources.
• Java socket programming provides facility to share data between different
The java.net package supports two protocols,
• TCP: Transmission Control Protocol provides reliable communication
between the sender and receiver. TCP is used along with the Internet
Protocol referred as TCP/IP.
• UDP: User Datagram Protocol provides a connection-less protocol service
by allowing packet of data to be transferred along two or more nodes
Java Networking Terminology
• IP Address
• Port Number
• MAC Address
• Connection-oriented and connection-less protocol
Open Database Connectivity (ODBC) IN JAVA
• Open Database Connectivity (ODBC) is an open standard application
programming interface (API) that allows application programmers to
access any database.
ODBC architecture consists of the following
• Application: An application which communicates with the databases using
ODBC functions is an ODBC application.
• ODBC driver manager: The ODBC diver manager manages the underlying
drivers in an application. Whenever an application calls a function of ODBC
API to communicate with a database, the driver manager accepts those
function calls and passes them to the ODBC driver. When the driver retrieves
the results from the database the driver manager accepts the results from
the driver and returns it back to the application.
• ODBC driver: The ODBC driver accepts the application function calls from the
driver manager and connects to the specified DataSource, retrieves the
required data and returns it back to the driver manager.
• Data source: A DataSource contains a set of data, environments associated
with it such as software to access the database, operating and network
Offenbar haben Sie einen Ad-Blocker installiert. Wenn Sie SlideShare auf die Whitelist für Ihren Werbeblocker setzen, helfen Sie unserer Gemeinschaft von Inhaltserstellern.
Sie hassen Werbung?
Wir haben unsere Datenschutzbestimmungen aktualisiert.
Wir haben unsere Datenschutzbestimmungen aktualisiert, um den neuen globalen Regeln zum Thema Datenschutzbestimmungen gerecht zu werden und dir einen Einblick in die begrenzten Möglichkeiten zu geben, wie wir deine Daten nutzen.
Die Einzelheiten findest du unten. Indem du sie akzeptierst, erklärst du dich mit den aktualisierten Datenschutzbestimmungen einverstanden.