0% found this document useful (0 votes)
12 views4 pages

labPrograms_AdvanceJava_BCA5sem_2024[1]

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)
12 views4 pages

labPrograms_AdvanceJava_BCA5sem_2024[1]

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/ 4

Program 1 - using statement interface

Create a simple Java program to connect to MySQL or Oracle DB and perform the below operations,

also Demonstrate usage of Execute, ExecuteUpdate, and ExecuteQuery

● Create a student table with columns USN (primary key), FN, LN, email, Phone, City, State, and
Pincode
● Insert at least 5 rows into the student table
● use the statement interface,
● perform necessary validation for data duplicity and constraint violations
● Retrieve student information from DB using USN as key.
● If USN is not present, show an appropriate message

Program 2 - using a prepared statement

Create a simple Java program to connect to MySQL or Oracle DB and perform the below operations.

also Demonstrate usage of Execute, ExecuteUpdate, and ExecuteQuery

● Create a Department table with columns DeptId(primary key), dept name


● Create an Employee table with columns EMP_ID(primary key) , FN,LN , email, Phone , City, State,
Pincode, DeptId (Foreign key)
● Insert at least 5 rows each into the Department, and Employee tables respectively
● use the prepared statement interface,
● perform necessary validation for data duplicity and constraint violations
● Retrieve Employee information from DB using EmpId OR DeptId as key.
● If no data is present, show an appropriate message

Program 3 - Using scrollable ResultSet

Create a Java program for a Library Management System to connect to a MySQL or Oracle database and
perform the following operations:

● Create a Books table with columns: Book_ID (Primary Key), Title, Author, Genre, Publisher, Year,
and ISBN (Unique).
● Insert at least 10 records into the Books table using PreparedStatement, ensuring validation to
prevent duplicate ISBN entries and invalid values.
● Retrieve book details by Book_ID or Title, with scrollable navigation (forward/backward),
displaying an appropriate message if no data is found.
● (4) Optionally, list books of a specific genre, sorted by publication year.
Program 4 - Servlets Dynamic page rendering

Create a simple servlet which extends the httpServlet class and perform the below operations.

● Create a simple html file which takes name and USN as input, along with submit button
● Upon Submission ,servlet will be invoked, which would receive the request
● and read request parameters and send the data read as a response back to the browser.

Program 5 - Servlets Dynamic page rendering - Calculator(Add,Subtract ,Divide ,Multiply)

Create a simple servlet which extends the httpServlet class and perform the below operations.

● Create a simple html file which takes 3 inputs from user along with submit button
o 1st text Input - Integer value
o 2nd text Input - Integer value
o 3rd Radio button Input - Operation(Add , Subtract , Divide)
● Upon submission, the servlet will be invoked, and the request parameters will be received.
Perform appropriate operation, and send back to the user with the response
● response would contain input values along with the result
● If no data is present, show an appropriate message
● Perform necessary data validation on input values and show an appropriate message

Program 6 - Servlets : Student Registration

Create a simple servlet that extends the httpServlet class and performs the below operations.

● Create a simple html file that takes student USN(primary key), FN, LN, email, Phone, City, State,
and pincode as input, along with the submit button
● Upon Submission, the servlet will be invoked, which will receive the request
● Read request parameters, save the data into DB,
● If no data is present, show an appropriate message
● Perform necessary data validation on input values and show an appropriate message.

Program 7 - Servlets : session Mgmt using Cookies

Demonstrate Session Management in Servlets using cookies - use the below input

● Create a minimum 2 servlets to add cookies and retrieve cookies respectively with an
appropriate response
● Create a simple html file that takes userName as input from the user
● along with the submit button
● Upon submission, userName will be read by FirstServlet, create and add a cookie object to the
response
● also generate a response which would contain form submission for secondServlet along with
submit button
● Upon submission, the second servlet would receive the cookie object from the browser and
● display the data retrieved from cookie as a response from secondServlet
Program 8 - Servlets: session Mgmt using Hidden Form fields

Demonstrate Session Management in Servlets using Hidden Form fields - use the below input

● Create minimum 2 servlets


● Create a simple html file that takes userName as input from the user along with the submit
button
● Upon submission, userName will be read by FirstServlet and generate a response which would
contain form submission with a hidden input field for secondServlet along with submit button
● Upon submission, the second servlet would receive the hidden form field value and
● display the data retrieved as a response from secondServlet

Program 9 - Servlets: session Mgmt using URL rewriting

Demonstrate Session Management in Servlets using Hidden Form fields - use the below input

● Create minimum 2 servlets


● Create a simple html file that takes userName as input from the user
● along with the submit button
● Upon submission, userName will be read by FirstServlet and generate a response which would
contain URL as a hyperlink for secondServlet
● Upon clicking on the url, the request would go to secondServlet, which would receive the input
values through URL and
● display the data retrieved as a response from secondServlet

Program 10 - Servlets: session Mgmt using HTTP Session

Demonstrate Session Management in Servlets using HTTP Session - use the below input

● Create a minimum 2 servlets to add session and retrieve sessions respectively with appropriate
response
● Create a simple html file that takes userName as input from the user along with the submit
button
● Upon submission, userName will be read by FirstServlet and create and add session object to
response
● also generate a response which would contain form submission for secondServlet along with the
submit button
● Upon submission, the second servlet would receive the session object from the browser and
● display the data retrieved from the session as a response from secondServlet
● also display session creation and last access time of the session

Program 11 - JSP: Scripting Elements

Demonstrate usage of scripting elements in JSP

● Create a JSP to perform the addition of 2 numbers.


Program 12 - JSP: Exception Handling

● Demonstrate exception handling in JSP using page attributes.

Program 13 - JSP: Exception Handling using web.xml

● Demonstrate exception handling in JSP using error-page element in web.xml.

Program 14 - JSP: Usage of implicit object request , session, and out

● Demonstrate the usage of implicit objects – request, session, and out.

Program 15 – SpringFrameWork - DI

● Demonstrate spring DI by constructor and setter method

You might also like