0% found this document useful (0 votes)
48 views55 pages

Java Programming-II - CM4109

This document outlines a laboratory manual for the Java Programming-II course. It includes the program outcomes to be achieved through course practicals related to developing GUI applications using AWT and Swing, client/server applications using sockets, database connectivity using JDBC, RMI applications, and servlets. It provides guidelines for teachers and students, and lists 12 practical exercises covering these topics along with a content page to record completion details. The practicals are designed to develop hands-on skills in Java programming and meet industry expectations.

Uploaded by

G1003 Amit Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
48 views55 pages

Java Programming-II - CM4109

This document outlines a laboratory manual for the Java Programming-II course. It includes the program outcomes to be achieved through course practicals related to developing GUI applications using AWT and Swing, client/server applications using sockets, database connectivity using JDBC, RMI applications, and servlets. It provides guidelines for teachers and students, and lists 12 practical exercises covering these topics along with a content page to record completion details. The practicals are designed to develop hands-on skills in Java programming and meet industry expectations.

Uploaded by

G1003 Amit Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 55

Java Programming-II (CM4109)

A Laboratory Manual

For

Java Programming-II
(CM4109)

Semester –V (CM)

Government Polytechnic Pune

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Programme Outcomes (POs) to be achieved through Practical of this Course


Following POs and PSO are expected to be achieved through the practical’s of the (Java
Programming-II (CM4109) Course.

Program Outcomes (PO)


1.Basic and Discipline specific knowledge: Ability to apply knowledge of basic
mathematics, science and engineering to solve the engineering problems.

2. Problem analysis: Identify and analyze well-defined engineering problems using discipline
specific knowledge.

3. Design/ development of solutions: Design solutions for well-defined technical problems


which will support design of systems components or processes to meet specified needs.

4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to demonstrate & practice experimental measurements.

5. Engineering practices for society, sustainability and environment: Understand the


impact of technology on social & environmental context, demonstrate the knowledge and need
for sustainable development, commitment towards professional ethics.

6. Project Management: Ability to apply engineering management principles individually, as


a team member or a leader to manage projects and effectively communicate about well-defined
engineering activities.

7. Life-long learning: Develop the ability to analyze individual needs and engage in updating
in the context of technological changes.

Program Specific Outcomes (PSOs)


1. PSO1: Ability to repair, maintain, and troubleshoot computer systems by applying
knowledge of computer hardware and peripheral.

2. PSO2: Ability to apply programming, multimedia, internet, web, and software engineering
principles to solve entry level problems in software domain.

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Practical - Course Outcome Matrix

Course Outcome:
a. Develop GUI applications using Abstract Windowing Toolkit (AWT) and event handling.
b. Create GUI applications using Swing.
c. Develop client/server applications using TCP/IP and UDP socket programming.
d. Implement Java programs using databases with Java Data Base Connectivity (JDBC) as interface.
e. Develop applications for Remote Method Invocation (RMI).
f. Implement Java programs using Servlets.

S. Title of the Practical CO CO CO CO CO CO


No.
a. b. c. d. e. f

1 Program to design a form using various controls different √ - - - - -


Layout’s manager.

2 Program to design Notepad application by using Menu class. √ - - - - -

3 Program to design a form using basic swing components √ √ - - - -


and use of tabbed panes and scroll panes in Swing.

4 Program to map Directory tree and Table. √ √ - - - -

5 Program to retrieve hostname using methods in InetAddress - - √ - - -


class, URL and URL Connection class.

6 Program that demonstrates TCP/IP and UDP based - - √ - - -


communication between client and server.

7 Program to make connectivity with database using JDBC API to - - - √ - -


send queries through JDBC bridge & handle result.

8 Create a Client/Server application using RMI. - - - - √ -

9 Program to demonstrate the use of HTTP Servlet as a - - - - - √


parameterized Servlet.

10 Program to send username and password using HTML forms - - - - - √


and authenticate the user using Servlet.

11 Program to create session using HTTP Session class to - - - - - √


implement Session tracking using Cookies.

12 Micro project (Refer point 11 for micro project list) √ √ √ √ √ √

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Guidelines to Teacher

1. There will be two sheets of blank pages after every practical for the student to report other
matters (if any), which is not mentioned in the printed practicals.
2. For difficult practical’s if required, teacher could provide the demonstration of the practical
emphasizing of the skills which the student should achieve.
3. Teachers should give opportunity to students for hands-on after the demonstration.
4. Assess the skill achievement of the students and Cos of each unit.
5. One or two questions ought to be added in each practical for different batches. For these
teachers can maintain various practical related question bank for each course.
6. For effective implementation and attainment of practical outcomes, teacher ought to ensure
that in the beginning itself of each practical, students must read through the complete write-
up of that practical sheet.
7. During practical, ensure that each student gets chance and takes active part in taking
observations/readings and performing practical’s.
8. Teacher ought to assess the performance of the students continuously according to the
guidelines given.

Instructions for Students

1. Students shall listen carefully the lecture given by teacher about importance of subject,
learning structure, course outcomes.
2. Students shall understand the purpose of experiment and its practical implementation.
3. Students shall write the answers of the questions during practical.
4. Student should feel free to discuss any difficulty faced during the conduct of practical.
Students shall develop web based and window-based applications as expected by the
industries.
5. Student shall attempt to develop related hands-on skills and gain confidence.
6. Students shall refer technical magazines; websites related to the scope of the subjects
and update their knowledge and skills.
7. Students shall develop self-learning techniques.
8. Students should develop habit to submit the write-ups on the scheduled dates and time.

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Content Page
List of Practical’s and Progressive Assessment Sheet
Sr. Title of the practical Page Date of Date of Assessment Dated Remar
No No. performance submission Marks (50) sign. of ks (if
teacher any)

1. Program to design a form using various


controls different Layout’s manager.
2. Program to design Notepad application
by using Menu class.
3. Program to design a form using basic
swing components and use of tabbed
panes and scroll panes in Swing.
4. Program to map Directory tree and
Table.
5. Program to retrieve hostname using
methods in InetAddress class, URL and
URL Connection class.

6. Program that demonstrates TCP/IP and


UDP based communication between
client and server.
7. Program to make connectivity with
database using JDBC API to send
queries through JDBC bridge & handle
result.
8. Create a Client/Server application using
RMI.

9. Program to demonstrate the use of Http


Servlet as a parameterized Servlet.

10. Program to send username and


password using HTML forms and
authenticate the user using Servlet.

11. Program to create session using Http


Session class to implement Session
tracking using Cookies.

12. Micro project (Refer point 11 for micro


project list)

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Practical No. 1

Tittle: Program to design a form using various controls and different Layout’s
manager.

I. Practical Significance:
Text Field, Text Area, Button, Checkbox, Radio Buttons (Check Box Group) List and
Choice Components are the AWT components. Used to design the GUI in java. A
component is object having representation that can be displayed on the screen to interact
with the user. A layout manager automatically arranges your controls within a window.
Components.

II. Relevant Program Outcomes (POs)


1. Basic and Discipline specific knowledge: Ability to apply knowledge of basic
mathematics, science and engineering to solve the engineering problems.

2. Problem analysis: Identify and analyze well-defined engineering problems using discipline
specific knowledge.

3. Design/ development of solutions: Design solutions for well-defined technical problems


which will support design of systems components or processes to meet specified needs.

4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to demonstrate & practice experimental measurements.

III. Competency and Practical skills


To develop standalone applications
The practical is expected to develop the following skills:
1. Able to design form using required AWT components
2. Able to understand the different Components available in AWT
3. Able to develop an applet/application using Choice and List components

IV. Relevant Course Outcome(s)


Develop GUI applications using Abstract Windowing Toolkit (AWT) and event handling.

V. Practical Outcome (PrOs)


1. Write a program to demonstrate the use of AWT components and different Layout
managers.
2. Write a program to design a form using the components List and Choice.

VI. Minimum therotical Background/ Algorithm /Flowchart/Subtopic


AWT is a java programming language class library. Components are visible objects that
can interact with the user. Containers (Frame, Panel, Applet) are used to hold
components using in a specific layout.

Using applet window, design following AWT components using add() method of
components class. Following are some AWT components

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

a. Label: Creates a label that displays a string.


b. TextField Creates and accepts a single-line text from user.
c. TextArea Creates and accepts multiple line text from user.
d. Button creates a push button.
e. Checkbox Creates a check box which is used to select multiple options.
f. CheckboxGroup creates a group of checkbox to act as radio button.
g. JLabel class is used to render a read-only text label or images on the UI. It does not
generate any event.
h. JRadioButton is used to render a group of radio buttons in the UI. A user can select one
choice from the group.
i. JList component renders a scrollable list of elements. A user can select a value or multiple
values from the list. This select behavior is defined in the code by the developer.
j. JComboBox class is used to render a dropdown of the list of options
k. JFileChooser class renders a file selection utility. This component lets a user select a file
from the local system

Layout Manager is a facility that determines how components should be arranged


when they are added to the container. Layout Manager is an interface that is
implemented by all the classes of layout managers. There are following classes that
represent the layout managers.

Layout Types
• Flow Layout
• Grid Layout
• Border Layout
• Card Layout
• Gridbag Layout

The default layout for different containers such as Applet, Frame, Panel. Grid Layout is used to
make a bunch of components equal in size and displays them in the requested number of rows
and columns. One component is displayed in each rectangle. The list of Constructor for
GridLayout are:
1. GridLayout(): creates a grid layout with one column per component in a row.
2. GridLayout(int rows, int columns): creates a grid layout with the given rows and
columns but no gaps between the components.
3. GridLayout(int rows, int columns, int hgap, int vgap): creates a grid layout with the
given rows and columns along with given horizontal and vertical gaps if we give
setLayout(null) the default layout is disabled.then we have to use setBounds method
to layout the components.
Constructors of CardLayout class
1. CardLayout(): creates a card layout with zero horizontal and vertical gap.
2. CardLayout(int hgap, int vgap): creates a card layout with the given horizontal
and vertical gap.

Commonly used methods of CardLayout class


1. public void next (Container parent): is used to flip to the next card of the given
container.
2. public void previous (Container parent): is used to flip to the previous card of

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

the given container.


3. public void first (Container parent): is used to flip to the first card of the given
container.
4. public void last (Container parent): is used to flip to the last card of the given
container.
5. public void show (Container parent, String name): is used to flip to the specified
card with the given name.

VII. Practical setup/figures circuits (if needed)


NA

VIII. Resources required


Sr. Name of Resource Broad Specification Quantity Remarks
No. (If any)

1 Computer System Computer (i3-i5 As per For All


preferable RAM > 2GB Batch Experiments
Size
2 Operating System Windows/Linux

3 Development JDK 1.5 Onwards


Software

IX. Precautions to be Followed


a. Handle Computer System with care.
b. Follow safety practices.

X. Procedure (as per IS code if applicable)


NA

XI. Actual Procedure Followed


NA

XII. Observations and calculations


NA

XIII. Result/s and interpretation of result/s /Graph (if applicable)


NA

XIV. Conclusions

XV. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)


1. Design an applet/application to demonstrate the use of Radio Button and
Checkbox.

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

2. Design an applet/application to create form using Text Field, Text Area, Button and
Label.
3. State the difference between List and Choice control
4. Write the use of getSelectedItem() and getSelectedIndex() for List.
5. List the names of BorderLayout regions.
6. Write the default horizontal and vertical gap in FlowLayout
7. Write the use of Insets in border layout.
8. Write a program code to generate the following output.

(Space for answer)

.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
......................................................................................................................................................
.......................................................................................................................................................

XVI. References/ Suggestions for Further Reading


1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert Schildt

XVII. Rubrics for evaluation (subject to modification as per the suggestions from
theHODs/Faculties)
Dated
Marks Obtained signature
of
Teacher

Attendance Performance Skills Safety precaution Conclusion Total


30% 20% -20% 10 % 20% 25

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Practical No. 2

Title: Program to design Notepad application by using Menu class.

I. Practical Significance:
The Menu Bar lets the user to select different menu options from the list of available
menu items and perform operations on the selected menu item.

II. Relevant Program Outcomes (POs)


1. Basic and Discipline specific knowledge: Ability to apply knowledge of basic
mathematics, science and engineering to solve the engineering problems.

2. Problem analysis: Identify and analyze well-defined engineering problems using


discipline specific knowledge.

3. Design/ development of solutions: Design solutions for well-defined technical problems


which will support design of systems components or processes to meet specified needs.

4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to demonstrate & practice experimental measurements.

III. Competency and Practical skills


To develop standalone applications
The practical is expected to develop the following skills:
1. Able to develop Menu, Menu Bar and Menu Items
2. Able to write a program using Menu Bar and assign shortcuts

IV. Relevant Course Outcome(s)


Develop programs using GUI Framework (AWT and Swing)

V. Practical Outcome (PrOs)


Write a program using AWT to create a menu bar where menu bar contains menu
items such as File, Edit, View and create a submenu under the File menu: New and
Open.

VI. Minimum Theoretical Background


A top-level window can have a menu bar associated with it. A menu bar displays a list
of top-level menu choices. Each choice is associated with a drop-down menu. This
concept is implemented in the AWT by the following classes: Menu Bar, Menu, and
Menu Item

To create a menu bar, first create an instance of Menu Bar. This class only defines the
default constructor. Next, create instances of Menu that will define the selections
displayed on the bar.
Menu( ) // creates an empty menu.
Menu(String optionName) // name of the menu selection
Menu(String optionName, boolean removable) // If removable is true, the menu
can be removed and allowed to float free. Otherwise, it will remain attached to
the menu bar.

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Individual menu items are of type MenuItem. It defines these constructors:


1. MenuItem( )
2. MenuItem(String itemName) // the name shown in the menu
3. MenuItem(String itemName, MenuShortcut keyAccel) // keyAccel is the menu
shortcut for this item
VII. Practical setup/figures circuits (if needed)
NA

VIII. Resources required


Sr. Name of Resource Broad Specification Quantity Remarks
No. (If any)

1 Computer System Computer (i3-i5 As per For All


preferable RAM > 2GB Batch Experiments
Size
2 Operating System Windows/Linux

3 Development JDK 1.5 Onwards


Software

IX. Precautions to be Followed


c. Handle Computer System with care.
d. Follow safety practices.

X. Procedure (as per IS code if applicable)


NA

XI. Actual Procedure Followed


NA

XII. Observations and calculations


NA

XIII. Result/s and interpretation of result/s /Graph (if applicable)


NA

XIV. Conclusions

XV. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)

1. Write the use of setEnabled() method


2. Write the procedure to assign shortcut key to the Menu Item
3. Write a syntax and use of addSeparator() method .
4. Find errors in following program and display output as shown below. import java.awt.*;
import java.awt.event.*;

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

public class MenuDemo1 extends Frame


{
MenuBar mb;
MenuItem m1,m2,m3,m4;
Menu mn;
MenuShortcut ms;
MenuDemo1()
{
setTitle("MenuBar Demo");
setSize(500,500);
setLayout(null);
ms=new MenuShortcut(KeyEvent.VK_X);
mn=new Menu("File");
mb=new MenuBar();
m1=new MenuItem("New...");
m2=new MenuItem("Open...");
m3=new MenuItem("Save As...");
m4=new MenuItem("Exit",ms);
mn.add(m1);
mn.add(m2);
mn.add(m3);
mn.addSeparator();
mn.add(m4);
mb.add(mn);
}
public static void main(String[] args)
{
MenuDemo1 md=new MenuDemo1();
md.setVisible(true);
}
}

(Space for answer)

......................................................................................................................................................
......................................................................................................................................................

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
.....................................................................................................................................................

XVI. References/ Suggestions for Further Reading


1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert Schildt

XVII. Rubrics for evaluation (subject to modification as per the suggestions from
theHODs/Faculties)
Dated
Marks Obtained signature
of
Teacher

Attendance Performance Skills Safety precaution Conclusion Total


30% 20% -20% 10 % 20% 25

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Practical No. 3

Title: Program to design a form using basic swing components and use of tabbed panes
and scroll panes in Swing.

I. Practical Significance:
The Swing Components are very useful to design interactive application and it provide
rich look and feel to the components. Swing components are light weight and platform
independent. Swing supplies additional controls such as TabbedPane, ScrollPane.

II. Relevant Program Outcomes (POs)


• Basic and Discipline specific knowledge: Ability to apply knowledge of basic
mathematics, science and engineering to solve the engineering problems.

• Problem analysis: Identify and analyze well-defined engineering problems using


discipline specific knowledge.

• Design/ development of solutions: Design solutions for well-defined technical problems


which will support design of systems components or processes to meet specified needs.

• Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to demonstrate & practice experimental measurements.

III. Competency and Practical skills


To develop standalone applications using swing components
The practical is expected to develop the following skills:
1. Able to Implement the TabbedPane and JScrollPane
2. Able to write the program using JApplet/JFrame

IV. Relevant Course Outcome(s)


1. Develop GUI applications using Abstract Windowing Toolkit (AWT) and event
handling.
2. Create GUI applications using Swing.

V. Practical Outcome (PrOs)


Write a program using swing to display tabbed panes and scroll panes.

VI. Minimum Theoretical Background

A JScrollPane is used to make a scrollable view of a component. A container that


provides horizontal and/or vertical scroll bars for another component.

The JTabbedPane class is used to switch between a group of components by clicking


on a tab with a given title or icon. It inherits JComponent class.

VII. Practical setup/figures circuits (if needed)


NA

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

VIII. Resources required


Sr. Name of Resource Broad Specification Quantity Remarks
No. (If any)

1 Computer System Computer (i3-i5 As per For All


preferable RAM > 2GB Batch Experiments
Size
2 Operating System Windows/Linux

3 Development JDK 1.5 Onwards


Software

IX. Precautions to be Followed


a. Handle Computer System with care.
b. Follow safety practices.

X. Procedure (as per IS code if applicable)


NA

XI. Actual Procedure Followed


NA

XII. Observations and calculations


NA

XIII. Result/s and interpretation of result/s /Graph (if applicable)


NA

XIV. Conclusions

XV. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)


1. Write a program code to generate the following output

Figure

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

2. State the difference between AWT and Swing


3. State the features of Swing
4. Name the method to obtain ContentPane in swing.
5. Develop a program to demonstrate the use of ScrollPane in Swings

(Space for answer)


......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
..................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
......................................................................................................................................................
.................................................................................................................................................

XVI. References/ Suggestions for Further Reading


1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert schildt

XVII. Rubrics for evaluation (subject to modification as per the suggestions from
theHODs/Faculties)
Dated
Marks Obtained signature
of
Teacher

Attendance Performance Skills - Safety Conclusion Total


30% 20% 20% precaution 10 % 20% 25

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Practical No.4

Title: Program to map Directory Tree and Table.

I. Practical Significance:
Tree is used to represent the hierarchical view of the data. The tree control shows the
data in tree like structure such as root and its leaves. A table is a component that displays
rows and columns of data. JTable class in Java which extends JComponent. The cursor
can be dragged on column boundaries to resize column.

II. Relevant Program Outcomes (POs)


• Basic and Discipline specific knowledge: Ability to apply knowledge of basic
mathematics, science and engineering to solve the engineering problems.

• Problem analysis: Identify and analyze well-defined engineering problems using


discipline specific knowledge.

• Design/ development of solutions: Design solutions for well-defined technical problems


which will support design of systems components or processes to meet specified needs.

• Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to demonstrate & practice experimental measurements.

III. Competency and Practical skills


To develop standalone applications using swing components
The practical is expected to develop the following skills:
1. Able to implement the JTree with its methods.
2. Able to write the program using JTree.
3. Able to implement the JTable with respective rows and columns.
4. Able to write the program using JTable and perform various operations on it.

IV. Relevant Course Outcome(s)


1. Develop GUI applications using Abstract Windowing Toolkit (AWT) and event
handling.
2. Create GUI applications using Swing.

V. Practical Outcome (PrOs)


Write a program to create a Jtree and JTable on applet window/Frame .

VI. Minimum Theoretical Background


JTree is a complex component. It has a 'root node' at the top most which is a parent
for all nodes in the tree. It inherits JComponent class.

Constrtuctors of JTree class

JTree(Hashtable ht) : The first form creates a tree in which each element of the hash
table ht is a child node.

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

JTree(Object obj[]): Each element of the array obj is a child node.

JTree(TreeNode tn):The tree node tn is the root of the tree.

JTree(Vector v):It uses the elements of vector v as child nodes.

Various Methods of JTree class :


1. getPathForLocation(): It is used to translate a mouse click on a specific point of the
tree to a tree path.

Syntax : TreePath getPathForLocation(int x,int y) where (x,y) are the coordinates at


which the mouse is clicked. The return value is as TreePath object that encapsulates
information about the tree node that was selected by the user.

TreeNode interface :It declares methods that obtain information about a tree node.

MutableTreeNode interface : It extends TreeNode.It declares methods that can insert


and remove child nodes or change the parent node.

DefaultMutableTreeNode class implements the MutableTreeNode interface.

It represents a node in a tree.

DefaultMutableTreeNode(Object obj):Here,obj is the object to be enclosed in this tree


node. The new tree node doesn’t have a parent or children. To create hierarchy of tree
nodes the add() can be used as

void add(MutableTreeNode child) :added child to the current node.

Tables are implemented by the JTable class, which extends JComponent.

Constructors of JTable:
1. JTable() : Creates a table with empty cells
2. JTable(Object data[ ][ ], Object colHeads[ ])
Here, data is a two-dimensional array of the information to be presented, and
colHeads
is a one-dimensional array with the column headings.

Here are the steps for using a table in an applet:


1. Create a JTable object.
2. Create a JScrollPane object. (The arguments to the constructor specify the table and the
policies for vertical and horizontal scroll bars.)
3. Add the table to the scroll pane.
4. Add the scroll pane to the content pane of the applet.

VII. Practical setup/figures circuits (if needed)


NA

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

VIII. Resources required


Sr. Name of Resource Broad Specification Quantity Remarks
No. (If any)

1 Computer System Computer (i3-i5 As per For All


preferable RAM > 2GB Batch Experiments
Size
2 Operating System Windows/Linux

3 Development JDK 1.5 Onwards


Software

IX. Precautions to be Followed


e. Handle Computer System with care.
f. Follow safety practices.

X. Procedure (as per IS code if applicable)


NA

XI. Actual Procedure Followed


NA

XII. Observations and calculations


NA

XIII. Result/s and interpretation of result/s /Graph (if applicable)


NA

XIV. Conclusions

XV. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)


1. Write the use of openConnection() method of URLConnection class.
2. Write the name of exception that can be thrown by URL class
3. Name the package in which URL class is defined.
4. Write a program using URL and URLConnection class to retrieve the date,content
type, content length information of any entered URL
5. Develop a program using InetAddress class to retrieve IP address of computer
when hostname is entered by the user.
6. Write any four differences between IPV4 and IPV6
7. Write the use of getByName() and getAllByName() method.
8. Write the steps to assign IP address to your machine

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

(Space for answer)


.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................

XVI. References/ Suggestions for Further Reading


1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert Schildt

XVII. Rubrics for evaluation (subject to modification as per the suggestions from
theHODs/Faculties)
Dated
Marks Obtained signature
of
Teacher

Attendance Performance Skills Safety Conclusion Total


30% 20% 20% precaution 10 % 20% 25

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Practical No. 5

Title: Program to retrieve hostname using methods in InetAddress class, URL and URL
Connection class.

I. Practical Significance:
Java provides the socket programming approach for communication between the client
and server. A user can write the code for both client and server as well for UDP& TCP
datagram packets. By using java’s network communication feature we can create
interactive application to communicate within a network.
The Uniform resource locator in java allows the user to access the particular file or resource
which might be stored on any local or remote machine. The URL specifies the complete
path by which user can access file. It contains protocol address, port number and location
of the particular resource.

II. Relevant Program Outcomes (POs)


• Basic and Discipline specific knowledge: Ability to apply knowledge of basic
mathematics, science and engineering to solve the engineering problems.

• Problem analysis: Identify and analyze well-defined engineering problems using


discipline specific knowledge.

• Design/ development of solutions: Design solutions for well-defined technical problems


which will support design of systems components or processes to meet specified needs.

• Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to demonstrate & practice experimental measurements.

III. Competency and Practical skills


To develop a program using InetAddress class, URL and URLConnection class
The practical is expected to develop the following skills:
1. Able to identify different types of ports and protocols
2. Able to develop an application using URL and URLConnection class.
3. Able to use the factory methods of InetAddress class
4. Able to write program using different constructors of the InetAddress class.

IV. Relevant Course Outcome(s)


Develop client/server applications using TCP/IP and UDP socket programming.

V. Practical Outcome (PrOs)


Write a program to demonstrate the use of InetAddress class.
Write a program to demonstrate the use of URL and URLConnection class.

VI. Minimum Theoretical Background


The java’s InetAddress encapsulates an IP address and used by the other networking classes
such as Socket, ServerSocket, URL, DatagramSocket, DatagramPacket. It is used to represent
both numerical and the domain name of the machine. InetAddress can handle both IPV4 and
IPV6.The InetAddress class has no visible constructors and it uses the following factory

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

methods.
1. static InetAddress getLocalHost( ) throws UnknownHostException
2. static InetAddress getByName(String hostName) throws UnknownHostException
3. static InetAddress[ ] getAllByName(String hostName) throws unknownHostException

The URL provides easy to understand format to uniquely identify or address information
on the internet. URLs are ample; every browser uses them to identify information on the
Web. URL class provides a simple, concise API to access information across the Internet
using URLs.

URLConnection is a class which is used to access the attributes of remote resource. Once
we made a connection to the remote resource, we are ready to use URLConnection to
check the properties of remote object before actually transportingit locally.

The URL and URLConnection classes are good enough for simple programs that wantto
connect to HTTP servers to fetch content.

List of URL Class Methods and Constructors:


1. public URL (String protocol, String host, int port, String file) throws
MalformedURLException
2. public URL (String protocol, String host, String file) throws
MalformedURLException
3. public URL(String url) throws MalformedURLException
4. public URL(URL context, String url) throws MalformedURLException

Methods:
1. public String getPath()
2. public String getAuthority()
3. public String getHost()
4. public String getFile()

List of URLConnection class Methods and Constructors:


The openConnection() method returns a java.net.URLConnection, an abstract class
whose subclasses represent the various types of URL connections.

Methods:
1. Object getContent()
2. String getContentEncoding()
3. int getContentLength()
4. String getContentType()
5. public URL getURL()

VII. Practical setup/figures circuits (if needed)


NA

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

VIII. Resources required


Sr. Name of Resource Broad Specification Quantity Remarks
No. (If any)

1 Computer System Computer (i3-i5 As per For All


preferable RAM > 2GB Batch Experiments
Size
2 Operating System Windows/Linux

3 Development JDK 1.5 Onwards


Software

IX. Precautions to be Followed


a. Handle Computer System with care.
b. Follow safety practices.

X. Procedure (as per IS code if applicable)


NA

XI. Actual Procedure Followed


NA

XII. Observations and calculations


NA

XIII. Result/s and interpretation of result/s /Graph (if applicable)


NA

XIV. Conclusions

XV. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)

1. Develop a program using InetAddress class to retrieve IP address of computerwhen


hostname is entered by the user.
2. Write any four differences between IPV4 and IPV6
3. Write the use of getByName() and getAllByName() method.
4. Write the steps to assign IP address to your machine
5. Develop a program using InetAddress class to retrieve IP address of computerwhen
hostname is entered by the user.

(Space for answer)


.......................................................................................................................................................

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
........................................................................................................................................................
..............................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
........................................................................................................................................................
..............................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
........................................................................................................................................................
..............................................................................................................................................
.......................................................................................................................................................

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

XVI . References/ Suggestions for Further Reading


1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert Schildt

XVII. Rubrics for evaluation (subject to modification as per the suggestions from
theHODs/Faculties)
Dated
Marks Obtained signature
of
Teacher

Attendance Performance Skills Safety Conclusion Total


30% 20% 20% precaution 10 % 20% 25

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Practical No. 6

Title: Program that demonstrates TCP/IP and UDP based communication between client and
server.

I. Practical Significance:
Java provides the socket programming approach for communication between the client and
server. A user can write the code for both client and server as well for UDP& TCP datagram
packets. By using java’s network communication feature we cancreate interactive application
to communicate within a network.
The User Datagram Protocol (UDP) is connectionless, and unreliable protocol by which the
user can send short messages called datagrams. The java provides DatagramSocket and
DatagramPacket class to implement the concept of userdatagram protocol. By using these
classes we can transfer the data asynchronous manner.

II. Relevant Program Outcomes (POs)


• Basic and Discipline specific knowledge: Ability to apply knowledge of basic
mathematics, science and engineering to solve the engineering problems.

• Problem analysis: Identify and analyze well-defined engineering problems using


discipline specific knowledge.

• Design/ development of solutions: Design solutions for well-defined technical problems


which will support design of systems components or processes to meet specified needs.

• Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to demonstrate & practice experimental measurements.

III. Competency and Practical skills


Develop web and stand-alone applications using advanced concepts of Java.
The practical is expected to develop the following skills:
1. Able to develop an application using Socket and ServerSocket class
2. Able to create a chat application in client server environment
3. Able to create chat application using DatagramSocket and DatagramPacket
4. Able to understand the implementation details of UDP in java.

IV. Relevant Course Outcome(s)


Develop client/server applications using TCP/IP and UDP socket programming.

V. Practical Outcome (PrOs)


1. Write a program to implement chat server using ServerSocket and Socket class.
2. Write a program to demonstrate use of DatagramSocket and DataGram Packet

VI. Minimum Theoretical Background


The ServerSocket class is used to create servers that listen for either local port or remote client
programs to connect to them on published ports.

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

Constructors for ServerSocket class


1. public ServerSocket(int port) throws IOException
2. public ServerSocket(int port, int backlog) throws IOException
3. public ServerSocket(int port, int backlog, InetAddress address) throws
IOException
4. public ServerSocket() throws IOException

Methods for ServerSocket class


1. public int getLocalPort()
2. public Socket accept() throws IOException
3. public void setSoTimeout(int timeout)
4. public void bind(SocketAddress host, int backlog)

The java.net.Socket class is used to communicate between client and server.The client can
obtain object by creating its instance whereas the server obtains a Socket objectfrom the
return value of the accept() method.

Constructors for Socket class:


1. public Socket(String host, int port) throws UnknownHostException, IOException.
2. public Socket(InetAddress host, int port) throws IOException
3. public Socket(String host, int port, InetAddress localAddress, int localPort) throws
IOException.
4. public Socket(InetAddress host, int port, InetAddress localAddress, int localPort)
throws IOException.
5. public Socket()

Methods for Socket class:


1. public void connect(SocketAddress host, int timeout) throws IOException
2. public InetAddress getInetAddress()
3. public int getPort()
4. public int getLocalPort()
5. public void close() throws IOException

The Java DatagramSocket class is used to send and receive the datagrams it is
connection less socket. That is there is no guarantee of message delivery.
It has following constructors
1. DatagramSocket()
2. DatagramSocket(int port)
3. DatagramSocket(int port, InetAddress address)

The Java DatagramPacket is class that can be used to send the packets. If you send multiple
packet, it may arrive in any order. Additionally, packet delivery is not guaranteed.
It has following constructors
1. DatagramPacket(byte[] barr, int length)
2. DatagramPacket(byte[] barr, int length, InetAddress address, int port)

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

VII. Practical setup/figures circuits (if needed)


NA

VIII. Resources required


Sr. Name of Resource Broad Specification Quantity Remarks
No. (If any)

1 Computer System Computer (i3-i5 As per For All


preferable RAM > 2GB Batch Experiments
Size
2 Operating System Windows/Linux

3 Development JDK 1.5 Onwards


Software

IX. Precautions to be Followed


c. Handle Computer System with care.
d. Follow safety practices.

X. Procedure (as per IS code if applicable)


NA

XI. Actual Procedure Followed


NA

XII. Observations and calculations


NA

XIII. Result/s and interpretation of result/s /Graph (if applicable)


NA

XIV. Conclusions

XV. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)


1. Write the difference between SeverSocket and DatagramPacket
2. Why UDP is unreliable protocol.
3. Write the steps to assign IP address to your machine.
4. Write a program using DatagramPacket and DataGramSocket to copy the contentsof
one file into other
5. Write a program using DatagramPacket and DatagramSocket to transfer the file
from one location to another.
6. Write the default port of used by various services such as FTP, SMTP, HTTP.

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

7. Write the constructor to allow the server for waiting queue


8. Write the function of Connect(), Bind()

(Space for answer)


.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
........................................................................................................................................................
..............................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................

Department of Computer Engineering, G. P. Pune


Java Programming-II (CM4109)

XVI. References/ Suggestions for Further Reading


1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert Schildt

XVII. Rubrics for evaluation (subject to modification as per the suggestions from
theHODs/Faculties)
Dated
Marks Obtained signature
of
Teacher

Attendance Performance Skills Safety Conclusion Total


30% 20% 20% precaution 10 % 20% 25

Department of Computer Engineering, G. P. Pune


Java Programming -II (CM4109)

Practical No. 7: Write a program to insert and retrieve data from database
using JDBC. Program to make connectivity with database using
JDBC API to send queries

I. Practical Significance:
ODBC isn't appropriate for direct use from the Java programming language because
it uses a C interface. The JDBC API was modeled after ODBC, but, because JDBC
is a Java API, it offers a natural Java interface for working with SQL. JDBC is
needed to provide a "pure Java" solution for application development.

II. Relevant Program Outcomes (POs)


PO1: Basic and Discipline Specific knowledge
PO3: Design/ development of solutions
PO4: Engineering Tools, Experimentation and Testing

III. Competency and Practical skills


To develop Dynamic web Application
The practical is expected to develop the following skills:
1. Able to apply the JDBC to create table , and insert data in a table.
2. Able to demonstrate the use of various JDBC driver and tier application.

IV. Relevant Course Outcome(s)


Implement Java programs using databases with Java Data Base Connectivity (JDBC) as
interface.

V. Practical Outcome (PrOs)


Write a program to insert and retrieve data from database using JDBC

VI. Minimum Theoretical Background


JDBC API enables the application to interact with the different types of databases.
It is possible to publish vital information from a remote database on a webpage
using the Java applet. JDBC is a low level API is used to invoke or call SQL
command directly. The required SQL statements are passed as a 'string' to java
methods.

Some of the current JDK add more features to JDBC that is embedded SQL which
makes direct mapping of relational databases to java classes. Embedded SQL
enables mixing of java into a SQL statement These statements are translated into
JDBC calls using SQL processor. In this type of direct mapping, each row of the
table becomes an instance of class and each column value corresponds to an
attribute of that instance.

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

 JDBC DRIVERS:-
1. JDBC-ODBC Bridge: -.
2. Native-API: - partly java Driver: -
3. JDBC-Network pure java driver:
4. Native_protocol (100%) pure Java drivers: -

 STEPS FOR USING JDBC


There are seven steps for using JDBC to access a database.
1. Import the Package: -
2. Register Driver or If register then load driver using Class.forName()-
3. Connect to Database:-
4. Create a Statement:-
5. .Execute the Statement:-
6. Retrieve the Results: -
 Prepared Statement Interface
PreparedStatement helps us in preventing SQL injection attacks because it
automatically escapes the special characters. PreparedStatement allows us to execute
dynamic queries with parameter inputs. PreparedStatement provides different types
of setter methods to set the input parameters for the query. PreparedStatement is
faster than Statement. It becomes more visible when we reuse the PreparedStatement
or use it‟s batch processing methods for executing multiple queries.
PreparedStatement helps us in writing object Oriented code with setter methods
whereas with Statement we have to use String Concatenation to create the query. If
there are multiple parameters to set, writing Query using String concatenation looks
very ugly and error prone. PreparedStatement returns FORWARD_ONLY ResultSet,
so we can only move in forward direction. Unlike Java Arrays or List, the indexing
of PreparedStatement variables starts with 1.
One of the limitation of PreparedStatement is that we can‟t use it for SQL queries
with IN clause because PreparedStatement doesn‟t allow us to bind multiple values
for single placeholder (?).
 Methods of Prepared Statements.
1. public void setInt(int paramIndex, int value)
2. public void setString(int paramIndex, String value)
3. public void setFloat(int paramIndex, float value
4. public void setDouble(int paramIndex, double value
5. public int executeUpdate()
6. public ResultSet executeQuery

 ResultSet Interface
The SQL statements that read data from a database query, return the data in a result
set. The SELECT statement is the standard way to select rows from a database and
view them in a result set. The java.sql.ResultSet interface represents the result set of a
database query.A ResultSet object maintains a cursor that points to the current row in
the result set.The term "result set" refers to the row and column data contained in a
ResultSetobject.The methods of the ResultSet interface can be broken down into three
categories −
Navigational methods:
Get methods:
Update methods
 JDBC provides the following connection methods to create statements
Department of Computer Engineering G.P.Pune
Java Programming -II (CM4109)

with desire ResultSet


 createStatement(int RSType, int RSConcurrency)
 prepareStatement(String SQL, int RSType, int RSConcurrency)
 prepareCall(String sql, int RSType, int RSConcurrency)
 Update methods
 JDBC provides the following connection methods to create statements
with desired ResultSet −
 createStatement(int RSType, int RSConcurrency);
 prepareStatement(String SQL, int RSType, int RSConcurrency);
 prepareCall(String sql, int RSType, int RSConcurrency);

VII. Resources used (Additional)

Sr. Name of
Broad Specification Quantity Remarks (If
No. Resource
any)

VIII. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)


Note: Below given are few sample questions for reference. Teachers must
design more such questions to ensure the achievement of identified CO.
1. List the advantages of JDBC over ODBC?
2. Write the Use of Class.forName()?
3. Write the steps to establish DSN oriented connection and DSNLess connection.
4. Develop a program to create employee table in database having two
columns“product_id” and “product_name”.
5. Develop a program to display the name and roll_no of students from
“studenttable” having percentage > 70.
6. Develop a program to update name of a student from Rama to Rohan.
7. Develop a program to delete all record for a product whose "price is
greater than 1000" and Id is "P1234".

(Space for answer)


.................................................................................................................................................
.... .......................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...........................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
IX. References/ Suggestions for Further Reading
1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert schildt
4. ftp://ftp.icm.edu.pl/packages/javasoft-docs/jdk1.1/jdbc.pdf
X. Assessment Scheme

Sr.No. Performance Indicators Weightage in


%
a. Correctness of Program 40
b. Debugging ability 20
c. Quality of input and output displayed 10
d. Preparing assignments 20
e. Submit assignment on time. 10
Total 100
List of student Team Members
1. ……………………...
2. ……………………...
3……………………….
4……………………….
Rubrics for evaluation(subject to modification as per the suggestions from the
HODs/Faculties)

Marks Obtained Dated


signature
of
Teacher
Attendance Performanc Skills Safety Conclusi Total
30% e 20% 20% precaution on 20% 25
10%

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

Practical No. 8: Program to create a Client/Server application using RMI.

I. Practical Significance:
ODBC isn't appropriate for direct use from the Java programming language because
it uses a C interface. The JDBC API was modeled after ODBC, but, because JDBC
is a Java API, it offers a natural Java interface for working with SQL. JDBC is
needed to provide a "pure Java" solution for application development.

II. Relevant Program Outcomes (POs)


PO1: Basic and Discipline Specific knowledge
PO2: Problem analysis
PO3: Design/ development of solutions
PO4: Engineering Tools, Experimentation and Testing

III. Competency and Practical skills


To develop Dynamic web Application
The practical is expected to develop the following skills:
3. Able to apply the JDBC to create table , and insert data in a table.
4. Able to demonstrate the use of various JDBC driver and tier application.

IV. Relevant Course Outcome(s)


Develop applications for Remote Method Invocation (RMI).
V. Practical Outcome (PrOs)
Program to create a Client/Server application using RMI.
VI. Minimum Theoretical Background
RMI (Remote Method Invocation)
The RMI (Remote Method Invocation) is an API that provides a mechanism to
create distributed application in java. The RMI allows an object to invoke methods on an
object running in another JVM.The RMI provides remote communication between the
applications using two objects stub and skeleton .RMI uses stub and skeleton object for
communication with the remote object.
A remote object is an object whose method can be invoked from another JVM. Let's
understand the stub and skeleton objects:
 stub
The stub is an object, acts as a gateway for the client side. All the outgoing requests
are routed through it. It resides at the client side and represents the remote object. When
the caller invokes method on the stub object, it does the following tasks:
1. It initiates a connection with remote Virtual Machine (JVM),
2. It writes and transmits (marshals) the parameters to the remote Virtual Machine (JVM),
3. It waits for the result
4. It reads (unmarshals) the return value or exception, and
5. It finally, returns the value to the caller.

 Skeleton
The skeleton is an object, acts as a gateway for the server side object. All the incoming
requests are routed through it. When the skeleton receives the incoming request, it does the
following tasks:
Department of Computer Engineering G.P.Pune
Java Programming -II (CM4109)

1. It reads the parameter for the remote method


2. It invokes the method on the actual remote object, and
3. It writes and transmits (marshals) the result to the caller.
In the Java 2 SDK, an stub protocol was introduced that eliminates the need for skeletons.
3. public void setFloat(int paramIndex, float value
4. public void setDouble(int paramIndex, double value
5. public int executeUpdate()
6. public ResultSet executeQuery
 (String SQL, int RSType, int RSConcurrency)
 prepareCall(String sql, int RSType, int RSConcurrency)
 Update methods

 Applications of RMI
1. The application need to locate the remote method
2. It need to provide the communication with the remote objects, and
3. The application need to load the class definitions for the objects.
 Java RMI Example
The is given the 6 steps to write the RMI program.
1. Create the remote interface
2. Provide the implementation of the remote interface
3. Compile the implementation class and create the stub and skeleton objects using the rmic
tool
4. Start the registry service by rmiregistry tool
5. Create and start the remote application
6. Create and start the client application
 RMI Example
In this example, we have followed all the 6 steps to create and run the rmi application. The client
application need only two files, remote interface and client application. In the rmi application, both
client and server interacts with the remote interface. The client application invokes methods on the
proxy object, RMI sends the request to the remote JVM. The return value is sent back to the proxy
object and then to the client application.

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

1) create the remote interfaceFor creating the remote interface, extend the Remote interface
and declare the RemoteException with all the methods of the remote interface. Here, we are
creating a remote interface that extends the Remote interface. There is only one method
named add() and it declares RemoteException.
import java.rmi.*;
public interface Adder extends Remote{
public int add(int x,int y)throws RemoteException;
}
2) Provide the implementation of the remote interface
o Now provide the implementation of the remote interface. For providing the
implementation of the Remote interface, we need to Either extend the
UnicastRemoteObject class, or use the exportObject() method of the
UnicastRemoteObject class .In case, you extend the UnicastRemoteObject class, you must
define a constructor that declares RemoteException.
import java.rmi.*;
import java.rmi.server.*;
public class AdderRemote extends UnicastRemoteObject implements Adder
{
AdderRemote()throws RemoteException{
super();
}
public int add(int x,int y){return x+y;}
}
3) create the stub and skeleton objects using the rmic tool.
Next step is to create stub and skeleton objects using the rmi compiler. The rmic tool invokes
the RMI compiler and creates stub and skeleton objects
rmic AdderRemote
4)Start the registry service by the rmiregistry tool
Now start the registry service by using the rmiregistry tool. If you don't specify the port
number, it uses a default port number. In this example, we are using the port number 5000.
rmiregistry 5000
5) Create and run the server application

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

Now rmi services need to be hosted in a server process. The Naming class provides methods
to get and store the remote object. The Naming class provides 5 methods.

VII. Resources used (Additional)

Sr. Name of
Broad Specification Quantity Remarks (If
No. Resource
any)

VIII. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)


Note: Below given are few sample questions for reference. Teachers must
design more such questions to ensure the achievement of identified CO.
1. What are the layers of RMI Architecture ?
2. What is the role of the java.rmi.Naming Class ?
3. What is the difference between using bind() and rebind() methods of Naming Class ?
4. Write steps involved to make work a RMI program ?
5. What is the role of Remote Interface in RMI ?

(Space for answer)


.................................................................................................................................................
.... .......................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
Department of Computer Engineering G.P.Pune
Java Programming -II (CM4109)

............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...........................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
IX. References/ Suggestions for Further Reading
1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert schildt
4. ftp://ftp.icm.edu.pl/packages/javasoft-docs/jdk1.1/jdbc.pdf
X. Assessment Scheme
Sr.No. Performance Indicators Weightage in
%
a. Correctness of Program 40
b. Debugging ability 20
c. Quality of input and output displayed 10
d. Preparing assignments 20
e. Submit assignment on time. 10
Total 100
List of student Team Members
1. ……………………...
2. ……………………...
3……………………….
4……………………….
Rubrics for evaluation(subject to modification as per the suggestions from the
HODs/Faculties)

Marks Obtained Dated


signature
of
Teacher
Attendance Performanc Skills Safety Conclusi Total
30% e 20% 20% precaution on 20% 25
10%

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

Practical No. 9: Write a program to demonstrate the use of HttpServlet as a


parameterized servlet

I. Practical Significance:
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 web
server, process the request, produce the response, and then send response back to
the web server.

II. Relevant Program Outcomes (POs)


PO1: Basic and Discipline Specific knowledge
PO2: Problem analysis
PO3: Design/ development of solutions
PO4: Engineering Tools, Experimentation and Testing

III. Competency and Practical skills


To develop Dynamic web Application
The practical is expected to develop the following skills:
1. Able to apply the servlet for dynamic web application.
2. Able to demonstrate the use of servlet for parameter received from client.

IV. Relevant Course Outcome(s)


Implement Java programs using Servlets.
V. Practical Outcome (PrOs)
Write a program to demonstrate the use of HttpServlet as a parameterized servlet

VI. Minimum Theoretical Background


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 web
server, process the request, produce the response, and then send response back to
the web server.

The Servlet Container


Servlet container, also known as Servlet engine is an integrated set of objects that
provide run time environment for Java Servlet components.
In simple words, it is a system that manages Java Servlet components on top of
theWeb server to handle the Web client requests.
The ServletRequest class includes methods that allow you to read the names and

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

values of parameters that are included in a client request.


 Methods of HttpServlet class
There are many methods in HttpServlet class. They are as follows:
1. public void service(ServletRequest req,ServletResponse res)
2. protected void service(HttpServletRequest req, HttpServletResponse res)
3. protected void doGet(HttpServletRequest req, HttpServletResponse res)
4. protected void doPost(HttpServletRequest req, HttpServletResponse res)
5. protected void doHead(HttpServletRequest req, HttpServletResponse res)
6. protected void doOptions(HttpServletRequest req, HttpServletResponse res)
7. protected void doPut(HttpServletRequest req, HttpServletResponse res)
8. protected void doTrace(HttpServletRequest req, HttpServletResponse res)
9. protected void doDelete(HttpServletRequest req, HttpServletResponse res)
10. protected long getLastModified(HttpServletRequest req)

Steps to Develop Servlet


Install Apache Tomcat 8.0
To develop servlet basic steps are
1. Create and compile the servlet source code.
D:\LabManual>javac HelloGpp.java -classpath "C:\ProgramFiles\Apache
Software Foundation\Tomcat 8.0\lib\servlet-api.jar"
2. Copy created .class file HelloGpp.class in web Container i.e
C:\Program Files\Apache Software Foundation\Tomcat 8.0\ webapps\ examples\
WEB-INF\classes
3. Start Tomcat.
To start Tomcat,select Start Tomcat in the Start | Programs menu, or run
startup.bat from the C:\Program Files\Apache Software Foundation\Tomcat
8.0\bin
4. Start a Web browser and request the servlet.
http://localhost:8080/examples/servlets/servlet/HelloGpp
XI. Resources used (Additional)

Sr. Name of
Broad Specification Quantity Remarks (If
No. Resource
any)

XII. Practical Related Questions (students to attempt 3 to 4 questions. Min 2)


Note: Below given are few sample questions for reference. Teachers must
design more such questions to ensure the achievement of identified CO.
1. What are the layers of RMI Architecture ?
2. What is the role of the java.rmi.Naming Class ?
3. What is the difference between using bind() and rebind() methods of Naming Class ?
4. Write steps involved to make work a RMI program ?
5. What is the role of Remote Interface in RMI ?

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

(Space for answer)


.................................................................................................................................................
.... .......................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
... .......................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...........................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.......................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
............................................................................................................................................................
.............................................................................................................................................................

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
VII. References/ Suggestions for Further Reading
1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert Schildt
4. https://tomcat.apache.org/download-80.cgi
XIII. Assessment Scheme
Sr.No. Performance Indicators Weightage in
%
a. Correctness of Program 40
b. Debugging ability 20
c. Quality of input and output displayed 10
d. Preparing assignments 20
e. Submit assignment on time. 10
Total 100
List of student Team Members
1. ……………………...
2. ……………………...
3……………………….
4……………………….

Rubrics for evaluation(subject to modification as per the suggestions from the


HODs/Faculties)
Marks Obtained Dated
signature
of
Teacher
Attendance Performanc Skills Safety Conclusio Total
30% e 20% 20% precaution n 20% 25
10%

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

Practical No. 10: Program to send username and password using HTML forms
and authenticate the user using Servlet

I. Practical Significance:
There is a possibility of developing „n‟ types of servlets, like httpservlet, ftpservlet,
smtp servlet etc. for all these protocol specific servlet classes GenericServlet is the
common super class containing common properties and logics. So, GenericServlet
is not a separate type of servlet.As of now Servlet API is giving only one subclass to
GenericServlet i.e HttpServlet class because all web servers are designed based on
the protocol http.

II. Relevant Program Outcomes (POs)


PO1: Basic and Discipline Specific knowledge
PO2: Problem analysis
PO3: Design/ development of solutions
PO4: Engineering Tools, Experimentation and Testing

III. Competency and Practical skills


To develop Dynamic web Application
The practical is expected to develop the following skills:
1. Able to apply the servlet program for dynamic web application.
2. Able to demonstrate the use of servlet for parameter received from client.

IV. Relevant Course Outcome(s)


Implement Java programs using Servlets.

V. Practical Outcome (PrOs)


Program to send username and password using HTML forms and authenticate
the user using Servlet.

VI. Minimum Theoretical Background


Generic servlets extend javax.servlet.GenericServlet - It is protocol independent
servlet. Generic Servlet is a base class servlet from which all other Servlets are
derived. Generic Servlet supports for HTTP, FTP and SMTP protocols. It
implements the Servlet and ServletConfig interface. It has only init() and destroy()
method of ServletConfig interface in its life cycle. It also implements the log
method of ServletContext interface.

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

HTTP servlets extend javax.servlet.HttpServlet - HTTPServlet is HTTP


dependent servlet. The HTTP protocol is a set of rules that allows Web browsers and
servers to communicate. When Web browsers and servers support the HTTP
protocol, Java- based web applications are dependent on HTTP Servlets.
HttpServlet is Extended by Generic Servlet. It provides an abstract class for the
developers for extend to create their own HTTP specific servlets.

VII. Resources used (Additional)

Sr. Name of
Broad Specification Quantity Remarks (If any)
No. Resource

VIII. Program Code: Teacher must assign a separate program statement to


group of3-4 students.

1. Write a Program to send the username to server and server will send the
length ofusername to client.
2. Write the output of following code considering below HTML is front end
andservlet as back end

loginpage.html
<html>
<body>
<form action="
http://localhost:8080/examples/servlets/servlet/AthonticationServlet”
method=”POST”>
User Name:<input type="text" name="username"><br>
Password:<input type="password" name="password" ><br>
<input type="submit">
</form>
</body>
</html>
//AthonticationServlet.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;import
javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class AthonticationServlet extends HttpServlet
{
protected void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
Department of Computer Engineering G.P.Pune
Java Programming -II (CM4109)

{
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String pass="abhishek12345";String
username,password;
username=request.getParameter("username");
password=request.getParameter("password");
if(username.equals(uname) && password.equals(pass))
{
out.println("Login Successfull");
}
else
{
out.println("Login Unsuccessfull");
}
}
}

(Space for Answer)


................................................................................................................................................................
.... .......................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...........................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.......................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
Department of Computer Engineering G.P.Pune
Java Programming -II (CM4109)

.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................

IX. Practical Related Questions


Note: Below given are few sample questions for reference. Teacher must
designmore such questions so as to ensure the achievement of identified CO.
1. List the types of servlet and default port for there services.
2. List the difference between doGet() and doPost() method of servlet.
3. Explain ServletConfig and ServletContext.
4. Explain ServletInputStream Class and ServletOutputStream Class with methods.
5. Develop servlet program to retrieve data from List and Radio Button using HTML
Forms.
6. Develop a program to receive student subject marks through HTML forms
TextField and send the response as passed or Failed in Examination
X. References/ Suggestions for Further Reading
1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert schildt
4. https://tomcat.apache.org/download-80.cgi

XI. Assessment Scheme

Sr.No. Performance Indicators Weightage in


%
a. Correctness of Program 40
b. Debugging ability 20
c. Quality of input and output displayed 10
d. Preparing assignments 20
e. Submit assignment on time. 10
Total 100

List of Students /Team Members

1. …………………………………..
2. …………………………………..

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

3. …………………………………..

Rubrics for evaluation (subject to modification as per the suggestions from the
HODs/Faculties)

Dated signature
Marks
of
Obtained
Teacher
Process
Product Related(15) Total(50)
Related(35)

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

Practical No. 11: Write a Servlet program to Create Session using


HttpSession class to implement Session tracking using
Cookies.

I. Practical Significance:
container creates a session id for each user. The container uses this id to identify the
particular user. An object of HttpSession can be used to perform two tasks:
1. bind objects
2. view and manipulate information about a session, such as the session
identifier,creation time, and last accessed time.

II. Relevant Program Outcomes (POs)


 Basic knowledge: Apply knowledge of basic mathematics, sciences and basic
engineering to solve the computer group related problems.
 Discipline knowledge: Apply Computer Programming knowledge to solve the
computer group related problems.
 Experiments and practice: Plan to perform experiments and practices to use
theresults to solve the computer group related problems.
 Engineering tools: Apply relevant Computer programming / technologies and
tools with an understanding of the limitations.
 Individual and Team work: Function effectively as a leader and team
member indiverse/multidisciplinary teams.
 Communication: Communicate effectively in oral and written form.

III. Competency and Practical skills


To develop Dynamic web Application
The practical is expected to develop the following skills:
1. Able to develop a servlet program to retrieve the session ID.
2. Able to develop Servlet program to track the user session

IV. Relevant Course Outcome(s)


Develop programs using Servlet.

V. Practical Outcome (PrOs)


Write a Servlet program to Create Session using HttpSession class.

VI. Minimum Theoretical Background


The Http Servlet Request interface provides two methods to get the object of
HttpSession:
1. public HttpSession getSession():Returns the current session associated with
this request, or if the request does not have a session, creates one.
2. public HttpSession getSession(boolean create):Returns the current
HttpSession associated with this request or, if there is no current session and
create is true, returns a new session

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

Commonly used methods of HttpSession interface


1. public String getId():Returns a string containing the unique identifier value.
2. public long getCreationTime():Returns the time when this session was created,
measured in milliseconds since midnight January 1, 1970 GMT.
3. 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.
4. public void invalidate():Invalidates this session then unbinds any objects
boundto it.
 Cookies
 A webserver can assign a unique session ID as a cookie to each web
client and for subsequent requests from the client they can be
recognized using the received cookie.
 This may not be an effective way because many time browser does not
support a cookie, so I would not recommend to use this procedure to
maintain the sessions.
 Hidden Form Fields
A web server can send a hidden HTML form field along with a unique session ID as
follows −
<input type = "hidden" name = "sessionid" value = "12345">

 URL Rewriting
You can append some extra data on the end of each URL that identifies the session,
and the server can associate that session identifier with data it has stored about that
session.

 The HttpSession Object


Apart from the above mentioned three ways, servlet provides HttpSession
Interface which 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.

 Types of Cookie
1. Non-persistent cookie
2. Persistent cookie

 Non-persistent cookie
It is valid for single session only. It is removed each time when user closes the
browser.

 Persistent cookie
It is valid for multiple session. It is not removed each time when user closes the
browser. It is removed only if user logout or sign-out.
javax.servlet.http.Cookie class provides the functionality of using cookies. It
provides a lot of useful methods for cookies.

 Other methods required for using Cookies


For adding cookie or getting the value from the cookie, we need some methods
provided by other interfaces.
Department of Computer Engineering G.P.Pune
Java Programming -II (CM4109)

1. public void addCookie(Cookie ck):method of HttpServletResponse interface is


used to add cookie in response object.
2. public Cookie[] getCookies():method of HttpServletRequest interface is used to
return all the cookies from the browser.

 Program
1. Write a Program to Session id and Session time in Browser Window.
2. Write the output of following code considering below HTML is front end and
servlet as back end

<html>
<body>
<form action="
http://localhost:8080/examples/servlet/SessionServlet">
Name:<input type="text" name="userName"/><br/>
<input type="submit" value="go"/>
</form>
</body>
</html>

//SessionServlet.java
import java.io.*;
import
javax.servlet.*;
import javax.servlet.http.*;

public class SessionServlet extends HttpServlet


{
public void doGet(HttpServletRequest request, HttpServletResponse response)
{
try
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String
n=request.getParameter("userName");
out.print("Welcome "+n);
HttpSession session=request.getSession();
session.setAttribute("uname",n);
out.print("<a href='servlet2'>visit</a>");
out.close();
}
catch (Exception e) {System.out.println(e);}
}
}

Department of Computer Engineering G.P.Pune


Java Programming -II (CM4109)

VII. Resources used (Additional)

Sr.
Name of Resource Broad Specification Quantity Remarks (If any)
No.
Web Server Apache Tomcat 8.0
1
Software with JRE.
2

(Space for Answer)


.......................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
...........................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
.......................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
............................................................................................................................................................
.
............................................................................................................................................................
.......................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................
.............................................................................................................................................................

Department of Computer Engineering G.P.Pune


VIII. Practical Related Questions
Note: Below given are few sample questions for reference. Teacher must
designmore such questions so as to ensure the achievement of identified CO.
1. Explain Session ID.
2. Explain Methods of HttpSession ?
3. Explain the session management in detail .?
4. Explain Session hijacking and session poisoning in Java Servlet.
5. Develop servlet program to display various details about session using
HttpSession methods.
6. Develop a program to display last accessed time of session. And Expire the
session with specified time
IX. References/ Suggestions for Further Reading
1. https://www.javatpoint.com
2. https://www.tutorialspoint.com/java
3. The complete reference Java 2 by Herbert schildt
4. https://tomcat.apache.org/download-80.cgi

X. Assessment Scheme

Sr.No. Performance Indicators Weightage in


%
a. Correctness of Program 40
b. Debugging ability 20
c. Quality of input and output displayed 10
d. Preparing assignments 20
e. Submit assignment on time. 10
Total 100

List of Students /Team Members

1. …………………………………..
2. …………………………………..
3. …………………………………..

Rubrics for evaluation(subject to modification as per the suggestions from the


HODs/Faculties)

Dated
Marks Obtained
signature
of Teacher
Process
Product Related(15) Total(50)
Related(35)

You might also like