0% found this document useful (0 votes)
9 views11 pages

AJ Assignments

The document contains a series of assignments for students at the Shri S'ad Vidya Mandal Institute of Technology, covering topics such as Java Networking, JDBC Programming, Servlet API, Java Server Pages, Hibernate, and Spring MVC. Each assignment includes multiple questions that require students to demonstrate their understanding of the respective topics through coding and explanations. The assignments aim to enhance practical skills in Java programming and web development.

Uploaded by

krishnakp0710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views11 pages

AJ Assignments

The document contains a series of assignments for students at the Shri S'ad Vidya Mandal Institute of Technology, covering topics such as Java Networking, JDBC Programming, Servlet API, Java Server Pages, Hibernate, and Spring MVC. Each assignment includes multiple questions that require students to demonstrate their understanding of the respective topics through coding and explanations. The assignments aim to enhance practical skills in Java programming and web development.

Uploaded by

krishnakp0710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY

(An Unaided Institution Established in 1996 and Approved by AICTE)


College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

Advanced Java (3160707)


Assignment-1
Java Networking

1 Discuss the difference between the Socket and ServerSocket class.


2 How to display IP address and host name for local machine or on which
the program runs
3 Write a client-server program using UDP socket. Client send the list of N
strings and server responds the concatenation of those strings
4 Write a client-server program using UDP socket. Client send list of N
numbers to server and server respond the sum of N numbers.
5 Write a client server program using TCP where client sends a string and
server checks whether that string is palindrome or not and responds with
appropriate message.
6 Write a client-server program using TCP or UDP where the client sends
10 numbers and server responds with the numbers in sorted order.
7 Write a client-server application using TCP Sockets where client can send
message and server respond with the reverse of them.
8 Write a TCP or UDP client and server program to do the following:
client> java client localhost/IP Port <enter>

Enter text: Welcome to Gujarat Technological UNIVERSITY <enter>


Response from server: ytisrevinu LACIGOLONHCEt TARAJUg TO
EMOCLEw
client> exit

//getLocalHost() will provide client localhost/IP Port 1-33


SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

//REVERSE WITH UPPER LOWER CASES...

9 What is Datagram socket? Explain it with example.


10. Explain following classes with their use
i) URL connection class
ii) Datagram socket
iii) Datagram packet
11. What is ServerSocket? How it works in java? Explain with help of
example
12. Describe the URL and URL connection class with their use in network
programming.
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

Assignment-2
JDBC Programming

1 What is JDBC? List out all various types of JDBC Driver. Explain
Thick and Thin driver. Write code snippet for each type of JDBC
connection. Comment on selection of driver.
or
Explain JDBC driver types in detail.
2 List the different types of JDBC drivers. Compare the various driver
types for their advantages and disadvantages
3 Show the use of PreparedStatement object to run precompiled SQL
statement. Also write example of java snippet for PreparedStaement.
4 Explain ResultSetMetaData with suitable Example.
Explain role of Prepared Statement and Callable with example.
or
Discuss CallableStatement with example.
5 Write a program to insert student records to database using prepared
statement.
6 Explain ResultSetMetaData with suitable example.
7 What is JDBC driver? What is its role? List the types of drivers and
explain Working of type-4 driver. Give the different ways to create the
JDBC connection With example
8 What is Callable statement? Write a procedure to insert a row into the
table student(roll_no,name,age) and call it using callable statement in
JDBC application.
9 Explain various types of JDBC drivers and comment on selection of
driver.
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

10 Explain the use of the Prepared Statement object of the JDBC with an
Appropriate example.
11 Write a JDBC program to insert and retrieve photo in databases.
12 Create a JDBC application to insert data into database and delete data
fromdatabases using statement.
13 Explain execute( ), execeteupdate( ) and executeQuery( ) Method.
14 Explain various types of JDBC drivers and comment on
Selection of driver.
15 Is the JDBC-ODBC Bridge Multi-threaded?
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

Assignment-3
Servlet API and overview

1 What is Servlet? List and Explain various stages of Servlet life


cycle. Explain role of web container
2 Write servlet which displayed following information of client.
I. Client Browser
II. Client IP address
III. Client Port No
IV. Server Port No
V. Local Port No
VI. Method used by client for form submission
VII. Query String name and values

3 Discuss use of GET and POST with example.


4 Differentiate the followings: (Any Three)
(I) GenericServlet vs HttpServlet
(II) doGet() vs doPost()
(III) Servlets vs CGI
(IV) Session and Cookie
(V) JSP vs Servlet
5 Design a form to input details of an employee and submit the data
to a servlet. Write code for servlet that will save the entered details
as a new record in database table Employee with fields (EmpId,
EName, Email, Age).

6 Explain use of ServletConfig and ServletContext object with


example.
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

7 Write a servlet that redirect requests alternatively to JSP Pages named


Odd and Even.
8 What is Request Dispatcher? What is the difference between
Request dispatcher’s forward() and include() method?
9 Explain various Session tracking mechanisms in servlet with
example.
10 What is session? List the different ways to manage the session.
11 Write a servlet RegistrationServlet to get the values from
registration.html html page and display the contents. Write the web.xml
file.
12 What is Filter? List the applications of filter.
13 Briefly explain the Servlet life cycle.
14 Write a Login servlet. Take input username and password from html file
login.html and authenticate the user. Write the web.xml.
15 Write a Servlet that takes two numbers as an input and display all the
prime numbers between them. Also write web.xml description for the
servlet.
16 Explain the configuration of filter using deployment descriptor.
17 Write Servlet program to create cookie. Also write code to display
contents of cookie on page.
18 What is web.xml? Explain it with code.
19 Explain various Session tracking mechanisms in servlet with example.
20 Design a form to input details of an employee and submit the data to a
servlet. Write code for servlet that will save the entered details as a new
record in database table Employee with fields (EmpId, EName, Email,
Age).
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

Assignment-4
Java Server Pages

1 Can one JSP or Servlet extend another Servlet or JSP? Justify your
answer.
2 Write a student bean class with property student_name,
enrollment_no, address and cpi. Write jsp page to set and
display all property.
3 List and Explain various stages of JSP life cycle. Briefly give
the function of each phase
4 Write line(s) of code in JSP for following.
Session read and write
URL rewriting sending and retrieving parameter(s)
URL redirection
. Print “hello world” as output
. Include the other JSP file statically
. Expression to display date as output
Method of setting the JSP parameters to use in JSTL
5 Compare the include and forward action tags in JSP.
6 What is session object in JSP? Show its use with proper
example.
7 Explain the action tags used to access the JavaBeans from a JSP
page with example.
8 Write JSP Page to demonstrate shopping cart using session feature
of JSP. Explain use of action tag with example.
9 What are the different methods to call java code from JSP page ?
Explain them.
10 Write a java bean named “student” having roll no and name
having getter & setter methods. Write a JSP page to set the roll
number and name for a student object and then print them by
reading from object.
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

11 Write a servlet that redirect requests alternatively to JSP Pages


named Odd and Even.
12 Write a JSP program using JSTL SQL taglib to display student
details in tabular form by iterating through the database table
student
13 Explain JSTL core tags.
14 Explain use of action tag with example.
15 How do we print “creates a new line in HTML” in JSP?
16 How to declare in a JSP page that Indicates whether or not the
page is intended to be an error page of some other JSP page.
17 What is difference between include directive and jsp:include
action tag?
18 List advantages of JSP over Servlet.
19 Explain any two-page directive in JSP with example.
20 Write a login.jsp page to get the login information from user and
authenticate user with the database with JSTL SQL tags.
21 List JSP implicit objects and explain any two.
22 Explain JSP inbuilt objects with their use in application.
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

Assignment-5
Java server faces 2.0
1 Draw the JSF request processing life cycle and briefly give the
function of each phase.
2 Explain JSF life cycle phases.
3 List the JSF facelets tags and explain any two.
4 List the JSF validation tags and explain any two.
5 What is JSF tag library? Explain any four-html tag.
6 What is web.xml? Explain it with code.
7 What are different JSF Converter tags?
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

Assignment-6
Hibernate 4.0

1 Draw and explain hibernate architecture.


2 What is ORM? Explain object/relational mappings in
hibernate
3 What is hibernate? What is main advantage of using hibernate
than using SQL?
4 What is hibernate? List the advantages of hibernate over
JDBC.
5 Develop program to get all students data from database using
hibernate.
6 Write necessary xml files.
7 What is O/R Mapping? How it is implemented using Hibernate
Explain with example.
8 Explain architecture of Hibernate.
9 What are the advantages of Hibernate over JDBC?
10 What is OR mapping? Give an example of Hibernate XML
mapping file.
11 What is HQL? How does it different from SQL? List its
advantages.
12 Explain the Hibernate cache architecture.
SHRI S’AD VIDYA MANDAL INSTITUTE OF TECHNOLOGY
(An Unaided Institution Established in 1996 and Approved by AICTE)
College Campus, Old-N.H-8., Bharuch – 392 001.
Affiliated to Gujarat Technological University, Ahmedabad.
Fax No. 02642-249601, email: [email protected]
Tel. No.: 02642-245864 / 9898263333.
Web Site: www.svmit.ac.in

Assignment-7
Java Web Frameworks: Spring MVC

1 What is Spring Web MVC Framework? List its key


features
2 Explain all modules of MVC Architecture in brief.
3 Discuss the application design with MVC architecture.
4 Briefly explain spring bean life cycle.
5 Develop small application using Spring MVC framework.
6 What is MVC architecture? Explain Spring architecture with
neat sketch.

You might also like