SlideShare a Scribd company logo
Thread
In Java, a thread always exists in any one of the following states. These
states are:
 New
 Active
 Blocked / Waiting
 Timed Waiting
 Terminated
• 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
following reasons:
• 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
1
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.
2
Parent packages Parent package of Applet includes java.applet.* and java.awt.* Parent package of Servlet includes javax.servlet.* and
java.servlet.http.*
3
Methods Important methods of applet includes init(), stop(), paint(), start(),
destroy().
Lifecycle methods of servlet are init( ), service( ), and destroy( ).
4
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.
5
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.
6
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,
button, etc
• 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:
• Window
• 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.
• Panel
• 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
add components.
• Frame
• 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.
• Dialog
Java Networking
• 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
computing devices.
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
• Protocol
• Port Number
• MAC Address
• Connection-oriented and connection-less protocol
• Socket
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
components.
• 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
platform.

More Related Content

Similar to Thread.pptx

Java basics notes
Java basics notesJava basics notes
Java basics notes
Gomathi Gomu
 
Key considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEWKey considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEW
Piotr Demski
 
Chat application through client server management system project.pdf
Chat application through client server management system project.pdfChat application through client server management system project.pdf
Chat application through client server management system project.pdf
Kamal Acharya
 
Zookeeper Tutorial for beginners
Zookeeper Tutorial for beginnersZookeeper Tutorial for beginners
Zookeeper Tutorial for beginners
jeetendra mandal
 
Java programming and security
Java programming and securityJava programming and security
Java programming and security
UmeshchandraYadav5
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
poonguzhali1826
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
ADEEBANADEEM
 
java.pptx
java.pptxjava.pptx
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
YounasKhan542109
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
Sumit Arora
 
Java servlets
Java servletsJava servlets
Java servlets
Mukesh Tekwani
 
1 java introduction
1 java introduction1 java introduction
1 java introduction
abdullah al mahamud rosi
 
1 java intro
1 java intro1 java intro
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
prat0ham
 
Liit tyit sem 5 enterprise java unit 1 notes 2018
Liit tyit sem 5 enterprise java  unit 1 notes 2018 Liit tyit sem 5 enterprise java  unit 1 notes 2018
Liit tyit sem 5 enterprise java unit 1 notes 2018
tanujaparihar
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
sunmitraeducation
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
dhananajay95
 
Java Ch 1.pptx
Java Ch 1.pptxJava Ch 1.pptx
Java Ch 1.pptx
VanitaPatil14
 
Class_01.pptx
Class_01.pptxClass_01.pptx
Class_01.pptx
Passion4Oracle
 

Similar to Thread.pptx (20)

Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Key considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEWKey considerations for multithreaded architectures in LabVIEW
Key considerations for multithreaded architectures in LabVIEW
 
Chat application through client server management system project.pdf
Chat application through client server management system project.pdfChat application through client server management system project.pdf
Chat application through client server management system project.pdf
 
Zookeeper Tutorial for beginners
Zookeeper Tutorial for beginnersZookeeper Tutorial for beginners
Zookeeper Tutorial for beginners
 
Java programming and security
Java programming and securityJava programming and security
Java programming and security
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
java.pptx
java.pptxjava.pptx
java.pptx
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
 
Java servlets
Java servletsJava servlets
Java servlets
 
1 java introduction
1 java introduction1 java introduction
1 java introduction
 
1 java intro
1 java intro1 java intro
1 java intro
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
 
Liit tyit sem 5 enterprise java unit 1 notes 2018
Liit tyit sem 5 enterprise java  unit 1 notes 2018 Liit tyit sem 5 enterprise java  unit 1 notes 2018
Liit tyit sem 5 enterprise java unit 1 notes 2018
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
 
Java Ch 1.pptx
Java Ch 1.pptxJava Ch 1.pptx
Java Ch 1.pptx
 
Class_01.pptx
Class_01.pptxClass_01.pptx
Class_01.pptx
 

More from Karthik Rohan

Normal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.pptNormal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.ppt
Karthik Rohan
 
introduction to Laravel and its Basic and origin
introduction to Laravel and its Basic and originintroduction to Laravel and its Basic and origin
introduction to Laravel and its Basic and origin
Karthik Rohan
 
unit-3-flip-flop-notes.pdf
unit-3-flip-flop-notes.pdfunit-3-flip-flop-notes.pdf
unit-3-flip-flop-notes.pdf
Karthik Rohan
 
BSc(IoT) - Digital.pptx
BSc(IoT) - Digital.pptxBSc(IoT) - Digital.pptx
BSc(IoT) - Digital.pptx
Karthik Rohan
 
Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
Karthik Rohan
 
Thread.pptx
Thread.pptxThread.pptx
Thread.pptx
Karthik Rohan
 
SVM_Sample.pptx
SVM_Sample.pptxSVM_Sample.pptx
SVM_Sample.pptx
Karthik Rohan
 
neuralnetwork.pptx
neuralnetwork.pptxneuralnetwork.pptx
neuralnetwork.pptx
Karthik Rohan
 
IT Unit III.pptx
IT Unit III.pptxIT Unit III.pptx
IT Unit III.pptx
Karthik Rohan
 
13598881-introduction-to-java-lecture-one.pdf
13598881-introduction-to-java-lecture-one.pdf13598881-introduction-to-java-lecture-one.pdf
13598881-introduction-to-java-lecture-one.pdf
Karthik Rohan
 
Thread.pptx
Thread.pptxThread.pptx
Thread.pptx
Karthik Rohan
 
AI-UNIT 1 FINAL PPT (1).pptx
AI-UNIT 1 FINAL PPT (1).pptxAI-UNIT 1 FINAL PPT (1).pptx
AI-UNIT 1 FINAL PPT (1).pptx
Karthik Rohan
 
UNIT4.2(VB).pptx
UNIT4.2(VB).pptxUNIT4.2(VB).pptx
UNIT4.2(VB).pptx
Karthik Rohan
 
BD1.pptx
BD1.pptxBD1.pptx
BD1.pptx
Karthik Rohan
 

More from Karthik Rohan (14)

Normal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.pptNormal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.ppt
 
introduction to Laravel and its Basic and origin
introduction to Laravel and its Basic and originintroduction to Laravel and its Basic and origin
introduction to Laravel and its Basic and origin
 
unit-3-flip-flop-notes.pdf
unit-3-flip-flop-notes.pdfunit-3-flip-flop-notes.pdf
unit-3-flip-flop-notes.pdf
 
BSc(IoT) - Digital.pptx
BSc(IoT) - Digital.pptxBSc(IoT) - Digital.pptx
BSc(IoT) - Digital.pptx
 
Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
 
Thread.pptx
Thread.pptxThread.pptx
Thread.pptx
 
SVM_Sample.pptx
SVM_Sample.pptxSVM_Sample.pptx
SVM_Sample.pptx
 
neuralnetwork.pptx
neuralnetwork.pptxneuralnetwork.pptx
neuralnetwork.pptx
 
IT Unit III.pptx
IT Unit III.pptxIT Unit III.pptx
IT Unit III.pptx
 
13598881-introduction-to-java-lecture-one.pdf
13598881-introduction-to-java-lecture-one.pdf13598881-introduction-to-java-lecture-one.pdf
13598881-introduction-to-java-lecture-one.pdf
 
Thread.pptx
Thread.pptxThread.pptx
Thread.pptx
 
AI-UNIT 1 FINAL PPT (1).pptx
AI-UNIT 1 FINAL PPT (1).pptxAI-UNIT 1 FINAL PPT (1).pptx
AI-UNIT 1 FINAL PPT (1).pptx
 
UNIT4.2(VB).pptx
UNIT4.2(VB).pptxUNIT4.2(VB).pptx
UNIT4.2(VB).pptx
 
BD1.pptx
BD1.pptxBD1.pptx
BD1.pptx
 

Recently uploaded

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 

Recently uploaded (20)

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 

Thread.pptx

  • 1. Thread In Java, a thread always exists in any one of the following states. These states are:  New  Active  Blocked / Waiting  Timed Waiting  Terminated
  • 2. • 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.
  • 3. • Timed Waiting: Sometimes, waiting for leads to starvation. • Terminated: A thread reaches the termination state because of the following reasons: • 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.
  • 4. The following are the important differences between Applets and Servlets. Sr. No. Key Applets Servlets 1 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. 2 Parent packages Parent package of Applet includes java.applet.* and java.awt.* Parent package of Servlet includes javax.servlet.* and java.servlet.http.* 3 Methods Important methods of applet includes init(), stop(), paint(), start(), destroy(). Lifecycle methods of servlet are init( ), service( ), and destroy( ). 4 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. 5 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. 6 Secure Applets are more prone to risk as execution is on the client machine. Servlets are more secure as execution is under server security.
  • 5. 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, button, etc • an AWT application will look like a windows application in Windows OS whereas it will look like a Mac application in the MAC OS.
  • 6. There are four types of containers in Java AWT: • Window • 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. • Panel • 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 add components. • Frame • 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. • Dialog
  • 7. Java Networking • 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 computing devices. 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
  • 8. Java Networking Terminology • IP Address • Protocol • Port Number • MAC Address • Connection-oriented and connection-less protocol • Socket
  • 9. 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.
  • 10. ODBC architecture consists of the following components. • 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 platform.