Advance Java Lab File
Advance Java Lab File
System Id: -
2022801407
Course: - BCA
Semester: 4th
3 Write a program to demonstrate the use of JSwing Components and add layout managers to it.
4 Create a login page in Swing and add events to it on click of login button.
5 Install a database (MySQL or Oracle). Program to illustrate JDBC connectivity. Program for
maintaining database by sending queries.
8 Write a program to insert a record in database using JDBC with the help of
Prepared Statement interface.
9 Write a JDBC program to display the details of employees (eno, ename, department, sal) whose
department is IT.
15 Write a program that provide the Generic Servlet class and its method implementation.
16 Write a HTTP servlet program to display Hello! This is Your First Servlet on browser and also
deploy the complete process into the container<web.xml> file.
17 Write a servlet program to select the details of an employee (emp id, empname,
empadd,empphone) and display on browser in appropriate format.
18 Write a JSP program to Print current date & time.
Index
Sr.No Name Of Experiment Date Of Date Of Remarks
Experiment Submission
Program 1:-
import java.util.*;
class Array {
int a[]={1,423,6,46,34,23,13,53,4};
Arrays.sort(a);
and
System.out.println("min-"+a[0]+" max-"+a[a.length-1]);
Output:-
Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons for the digits
and for the +,-,*, % operations. Add a text field to display the result. Handle any possible exceptions like
divided by zero
Output:-
Program 2:- Write a GUI program to demonstrate the use of AWTCounter class.
import java.awt.*;
import java.awt.event.*;
public AWTCounter() {
setLayout(new FlowLayout());
countButton.addActionListener(this);
setTitle("AWT Counter");
setSize(250, 100);
setVisible(true);
}
Output:-