0% found this document useful (0 votes)
30 views

Java Programs Questions Assginment

The document contains programming exercises for servlets, JSP, JSTL and EJB. It includes tasks like creating registration forms, currency converters, calculators, retrieving and updating database records, using sessions and cookies.

Uploaded by

tiahey060204
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Java Programs Questions Assginment

The document contains programming exercises for servlets, JSP, JSTL and EJB. It includes tasks like creating registration forms, currency converters, calculators, retrieving and updating database records, using sessions and cookies.

Uploaded by

tiahey060204
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

I.

SERVLET PROGRAMS
1. Write a simple servlet program that will display the factorial of a given
number.
2. Write a servlet program that will read a string from a user. If the string is
‘Examination’ then greet the user otherwise display error message.
3. Write a servlet that prints the sum of square of n integer numbers.
4. Write a servlet application to find the sum of digits of the number entered by
the user through the HTML form.
5. Write a servlet application for simple calculator.
6. Create a registration servlet in Java using JDBC. Accept the details such as
Username, Password, Email and Country from the user using HTML Form
and store the registration details in the database.
7. Write a program using JDBC API using Servlet to retrieve data from the
database. If the student details table contains name varchar2(20), age
Number(3), Phone Number(10):
a) Show all the records from the table.
8. Write a program using JDBC API to create the following table student details
in Derby/SQL database:
a) Create a table with detail as Student_name varchar2(50), Age
varchar2(20), Phone_number(10).
9. Write a JDBC application using Servlet for the following form:
First Name:
Last Name:
Password:
Confirm Password:
On submit form button: Information should be stored in the database.
On Reset form: All the fields should be cleared.
Use Table: Login (loginid varchar Primary key, firstname varchar, lastname
varchar, password varchar, confirmpassword varchar).
10. Write a servlet that accepts a table name sent from an html page and retrieves
the content of that table from the database in a tabular form on the screen.
11. Using request dispatcher interface create a servlet which will validate the
password enter by the user using jdbc from the data base for correct
credentials forward to welcome servlet else the user will stay on index.html
and an error message will be displayed.
12.

II. JSP Programs


1. Print current date and time.
2. JSP Program to count number of visitors on website.
3. JSP Program for session tracking.
4. Demonstrate expression tag.
5. Detect locale, language setting and local specific time..
6. JSP Program to validate username and password.
7. JSP Program to retrieve record from database.
8. Write a JSP program for currency converter (INR to USD) and temperature converter
(Celsius to Fahrenheit).
9. JSP program calculator to square root and cube root and identify if it is Odd or Even.
10. JSP program registration and authentication a user using a JDBC.
11. JSP program to update employee table (salary, designation, department, id, name).
12. JSP program to print square of n numbers.
13. JSP program for factorial
14. JSP program to display Fibonacci series.
15. Take an input of the number square numbers up to the entered number.
16. JSP app to find odd or even number.
17. JSP page to upgrade employee details using the employee number entered.
18. Simple JSP application to display values obtained from the use of intrinsic objects
III. JSTL Programs
1. Write a JSP program using JSTL, take a input from the user and display square of
the numbers upto entered number.
2. Write a JSP program using JSTL, to input marks from the user and display
obtained grade.
3. Write a JSP program using JSTL, to print greater of the three numbers entered.
4. Write a JSP program using JSTL, to print the multiples of the number entered.
5. Write a JSP program using JSTL, to take 2 strings from the user and check the
following:
a) If s2 is a substring of s1 count display the length of each string.
b) s2 is a part of s1 (case sensitive)
c) To check if s1 starts with "The"
d) convert strings to upper case and lower case
6. Display date and time in IST as: -
a) February 10, 2023 08:15:20 IST
b) Feb 10, 2023
c) 02/10/2023 08:20 AM
7. Using JSTL Registration, Login and Update the salary of the employee.

Create a servlet that uses cookies to store the number of time a user has visited the servlet.
Create a servlet demonstrating the use of session creation and destruction also check the
number of visits and the other details of session.
Develop simple servlet question answer application using database.
Write a servlet program to Upload a file.
Create a currency converter application using EJB.
Develop a simple EJB application to demonstrate servlet hit count using singleton session
beans.
Develop a hibernate application to store the feedback of website visitor in database.

You might also like