Java Programs Questions Assginment
Java Programs Questions Assginment
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.
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.