Java
Java
Page
SECTION:C2 A22205316002
Program to generate random number using random class
import [Link];
public class Randoms
{
public static void main(String args[])
{ Random rand = new Random();
int rand_int1 = [Link](1000);
[Link]("Random Integers: "+rand_int1);
}}
2
Page
SECTION:C2 A22205316002
3
Page
SECTION:C2 A22205316002
Program to print Fibonacci series for a given series.
import [Link].*;
public class Fibo
{ public static void main(String args[])
{ int n1=1,n2=1,n3;
Scanner s = new Scanner([Link]);
int n = [Link]();
[Link](n1+" "+n2);
for(int i=2;i<n;i++)
{ n3 = n1 + n2;
n1=n2;
n2=n3;
[Link](" "+n3);
}
}
}
4
Page
SECTION:C2 A22205316002
5
Page
SECTION:C2 A22205316002
Program to check wheather a given number is palindrome.
import [Link].*;
class recurs
{
if (temp == n)
[Link]("yes");
else
[Link]("no" );
}
6
Page
SECTION:C2 A22205316002
7
Page
SECTION:C2 A22205316002
Program to reverse a given string.
import [Link].*;
import [Link].*;
import [Link].*;
class Rev
[Link](input);
input1 = [Link]();
[Link](input1);
}
8
Page
SECTION:C2 A22205316002
9
Page
SECTION:C2 A22205316002
Program to print Factorial of a given number.
import [Link].*;
class Fact
{
static int Factorial(int n)
{if(n==0)
return 1;
else
return (n*Factorial(n-1));
}
public static void main(String args[])
{ Scanner s = new Scanner([Link]);
int n = [Link]();
int fact = Factorial(n);
[Link](fact);
}}
10
Page
SECTION:C2 A22205316002
11
Page
SECTION:C2 A22205316002
Program to print Login using awt components and events.
import [Link].*;
import [Link].*;
SECTION:C2 A22205316002
un=new TextField();
pas=new TextField();
b1=new Button("OK");
b2=new Button("CANCEL");
[Link]('$');
[Link](50,50,80,20);
[Link](50,90,80,20);
[Link](150,50,80,20);
[Link](150,90,80,20);
[Link](70,150,70,20);
[Link](170,150,70,20);
add(l1);
add(l2);
add(b1);
add(b2);
add(un);
add(pas);
setLayout(null);
setVisible(true);
setSize(500,500);
[Link]
(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
13
{
Page
if([Link]().equals("123"))
SECTION:C2 A22205316002
{
setVisible(false);
w=new Welcome([Link]());
[Link](true);
}
}
}
);
[Link]
(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
dispose();
}
}
);
new Login();
}
14
}
Page
SECTION:C2 A22205316002
15
Page
SECTION:C2 A22205316002
Program to change the color of foreground and background
using awt components.
import [Link].*;
import [Link].*;
public class color extends Frame
{
Label l1;
Checkbox c1,c2;
//CheckboxGroup cbg;
color()
{super("color");
l1 = new Label("helloworld");
c1 = new Checkbox("background");
c2 = new Checkbox("foreground");
[Link](50,100,100,100);
[Link](50,150,100,100);
[Link](50,200,100,100);
add(l1);
add(c1);
add(c2);
[Link](new ItemListener()
{ public void itemStateChanged( ItemEvent ae)
{
16
setBackground([Link]);
Page
SECTION:C2 A22205316002
});
[Link](new ItemListener()
{ public void itemStateChanged( ItemEvent ae)
{
[Link]([Link]);
}
});
setLayout(null);
setSize(250,250);
setVisible(true);
}
public static void main(String args[])
{
new color();
}}
17
Page
SECTION:C2 A22205316002
18
Page
SECTION:C2 A22205316002
Program to change the font using awt components and events.
import [Link].*;
import [Link].*;
//import [Link];
//import [Link];
class font extends Frame
{ Frame f = new Frame();
Label l1;
Checkbox c1,c2,c3,c4;
CheckboxGroup cbg;
font()
{
super("change font");
l1 = new Label("helloworld");
c1 = new Checkbox("bold",cbg,false);
c2 = new Checkbox("italic",cbg,false);
c3 = new Checkbox("fontitalic",cbg,false);
c4 = new Checkbox("normal",cbg,true);
[Link](50,100,100,100);
[Link](50,150,100,100);
[Link](150,150,100,100);
[Link](250,150,100,100);
[Link](350,150,100,100);
add(l1);
add(c1);
19
add(c2);
Page
add(c3);
SECTION:C2 A22205316002
add(c4);
[Link](new ItemListener()
{public void itemStateChanged(ItemEvent ae)
{ [Link](false);
[Link](false);
[Link](false);
[Link](new Font("Courier New", [Link], 12));}
});
[Link](new ItemListener()
{public void itemStateChanged(ItemEvent ae)
{[Link](false);
[Link](false);
[Link](false);
[Link](new Font("Courier New", [Link], 12));}
});
[Link](new ItemListener()
{public void itemStateChanged(ItemEvent ae)
{[Link](true);
[Link](true); }
});
[Link](new ItemListener()
{public void itemStateChanged(ItemEvent ae)
{[Link](false);
[Link](false);
[Link](false); }
});
20
addWindowListener(new WindowAdapter(){
Page
SECTION:C2 A22205316002
dispose();
}
});
setLayout(null);
setSize(250,250);
setVisible(true);
}
public static void main(String args[])
{
new font();
}
}
21
Page
SECTION:C2 A22205316002
22
Page
SECTION:C2 A22205316002
Program to implement JLabel on jframe.
import [Link].*;
class Labels
{
public static void main(String args[])
{
JFrame f= new JFrame("padmagopal");
JLabel l1,l2;
l1=new JLabel("padmagopal");
[Link](50,50, 100,30);
l2=new JLabel("Btech cse.");
[Link](50,100, 100,30);
[Link](l1); [Link](l2);
[Link](300,300);
[Link](null);
[Link](true);
}
}
23
Page
SECTION:C2 A22205316002
24
Page
SECTION:C2 A22205316002
Program to show message dialog box using JOptionPane.
import [Link].*;
public class Op {
JFrame f;
Op(){
f=new JFrame();
[Link](f,"Hello, welcome padmagoapl.");
}
public static void main(String[] args) {
new Op();
}
}
25
Page
SECTION:C2 A22205316002
26
Page
SECTION:C2 A22205316002
Program to implement JButton in Jframe
import [Link].*;
public class Buttons {
public static void main(String[] args) {
JFrame f=new JFrame("PADMAGOpal");
JButton b=new JButton("Click Here");
[Link](50,100,95,30);
[Link](b);
[Link](400,400);
[Link](null);
[Link](true);
}
}
27
Page
SECTION:C2 A22205316002
28
Page
SECTION:C2 A22205316002
Program to implement JTextField in Jframe
import [Link].*;
class Texts
{
public static void main(String args[])
{
JFrame f= new JFrame("PADMAGOPAL");
JTextField t1,t2;
t1=new JTextField("pADMAGOAPL.");
[Link](50,100, 200,30);
t2=new JTextField("CSE");
[Link](50,150, 200,30);
[Link](t1); [Link](t2);
[Link](400,400);
[Link](null);
[Link](true);
}
}
29
Page
SECTION:C2 A22205316002
30
Page
SECTION:C2 A22205316002
Program to implement JTextArea in Jframe
import [Link].*;
public class TextAreas{
TextAreas(){
JFrame f= new JFrame();
JTextArea area=new JTextArea("GOPAL");
[Link](10,30, 200,200);
[Link](area);
[Link](300,300);
[Link](null);
[Link](true);
}
public static void main(String args[])
{
new TextAreas();
}}
31
Page
SECTION:C2 A22205316002
32
Page
SECTION:C2 A22205316002
Program to implement JTextArea in Jframe
import [Link].*;
public class Passwords {
public static void main(String[] args) {
JFrame f=new JFrame("Password Field Example");
JPasswordField value = new JPasswordField();
JLabel l1=new JLabel("Password:");
[Link](20,100, 80,30);
[Link](100,100,100,30);
[Link](value); [Link](l1);
[Link](300,300);
[Link](null);
[Link](true);
}
}
33
Page
SECTION:C2 A22205316002
34
Page
SECTION:C2 A22205316002
Program to implement JCheckBox in Jframe
import [Link].*;
public class Checks {
Checks(){
JFrame f= new JFrame("PADMAGOPAL");
JCheckBox checkBox1 = new JCheckBox("TN");
[Link](100,100, 50,50);
JCheckBox checkBox2 = new JCheckBox("KK", true);
[Link](100,150, 50,50);
[Link](checkBox1);
[Link](checkBox2);
[Link](400,400);
[Link](null);
[Link](true);
}
public static void main(String args[])
{
new Checks();
}}
35
Page
SECTION:C2 A22205316002
36
Page
SECTION:C2 A22205316002
Program to implement JRadioButton in Jframe
import [Link].*;
public class Radios {
JFrame f;
Radios(){
f=new JFrame();
JRadioButton r1=new JRadioButton("A) PADMAGOAPL ");
JRadioButton r2=new JRadioButton("B) MSD ");
[Link](75,50,100,30);
[Link](75,100,100,30);
ButtonGroup bg=new ButtonGroup();
[Link](r1);[Link](r2);
[Link](r1);[Link](r2);
[Link](300,300);
[Link](null);
[Link](true);
}
public static void main(String[] args) {
new Radios();
}
}
37
Page
SECTION:C2 A22205316002
38
Page
SECTION:C2 A22205316002
Program to implement JComboBox in Jframe
import [Link].*;
public class Combos {
JFrame f;
Combos(){
f=new JFrame("ComboBox Example");
String country[]={"India","Aus","U.S.A","England","Newzealand"};
JComboBox cb=new JComboBox(country);
[Link](50, 50,90,20);
[Link](cb);
[Link](null);
[Link](400,500);
[Link](true);
}
public static void main(String[] args) {
new Combos();
}
}
39
Page
SECTION:C2 A22205316002
40
Page
SECTION:C2 A22205316002
Program to implement JList in Jframe
import [Link].*;
public class Lis
{
Lis(){
JFrame f= new JFrame();
DefaultListModel<String> l1 = new DefaultListModel<>();
[Link]("cse");
[Link]("mech");
[Link]("chem");
[Link]("civul"); a
JList<String> list = new JList<>(l1);
[Link](100,100, 75,75);
[Link](list);
[Link](400,400);
[Link](null);
[Link](true);
}
public static void main(String args[])
{
new Lis();
}}
41
Page
SECTION:C2 A22205316002
42
Page
SECTION:C2 A22205316002
Program to implement JSpinner in Jframe
import [Link].*;
public class SpinnerExample {
public static void main(String[] args) {
JFrame f=new JFrame("Spinner Example");
SpinnerModel value =
new SpinnerNumberModel(5, //initial value
0, //minimum value
10, //maximum value
1); //step
JSpinner spinner = new JSpinner(value);
[Link](100,100,50,30);
[Link](spinner);
[Link](300,300);
[Link](null);
[Link](true);
}
}
43
Page
SECTION:C2 A22205316002
44
Page
SECTION:C2 A22205316002
Program to implement confirm dialog box in Jframe
import [Link];
import [Link];
import [Link];
45
Page
SECTION:C2 A22205316002
46
Page
SECTION:C2 A22205316002
Program to implement Input dialog box in Jframe
import [Link];
import [Link];
public class Inputs {
[Link](result);
}
47
Page
SECTION:C2 A22205316002
48
Page
SECTION:C2 A22205316002
Program to fetch record from database and print it.
import [Link].*;
public class dbs
{
public static void main(String args[])
{ try{
Connection con;
Statement st;
ResultSet rs;
[Link]("[Link]");
[Link]("test");
con=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]");
[Link]("test");
st=[Link]();
rs=[Link]("select * from info");
while([Link]())
{ [Link]([Link](1)+" , "+[Link](2));
}
[Link]();
}
catch(Exception e)
{ [Link](e);
}
}
}
49
Page
SECTION:C2 A22205316002
50
Page
SECTION:C2 A22205316002
Program to add and fetch record of STATE,CITY AND VILLAGE
from database and print it.
//program to add state
import [Link].*;
import [Link].*;
import [Link].*;
public class ins extends Frame
{
Label l1 ;
TextField un;
Button b1;
ins() {
l1=new Label("state: ");
un=new TextField();
b1=new Button("OK");
[Link](50,50,80,20);
[Link](150,50,80,20);
[Link](70,150,70,20);
add(l1);
add(b1);
add(b2);
add(un);
add(pas);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {
dispose();
}
});
51
[Link]
Page
SECTION:C2 A22205316002
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
Connection con;
Statement st;
ResultSet rs;
[Link]("[Link]");
[Link]("test");
con=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]
b");
[Link]("test");
String s = [Link]();
st=[Link]();
[Link]("Insert into state (SNAME) values( '"+s+"')");
[Link]("insered sucessfully;");
[Link]();
}
catch(Exception f)
{
[Link](f);
}
}
}
);
52
Page
SECTION:C2 A22205316002
setLayout(null);
setVisible(true);
setSize(500,500);
}
public static void main(String args[])
{
new ins();
}
}
//program to add city and fetch village
import [Link].*;
import [Link].*;
import [Link].*;
public class insc extends Frame
{
Choice c1;
TextField t1;
Button b1;
insc()
{
c1 = new Choice();
t1 = new TextField();
b1 = new Button("add");
[Link](50,100,80,20);
[Link](150,100,80,20);
53
[Link](130,150,80,20);
Page
SECTION:C2 A22205316002
add(c1);
add(t1);
add(b1);
try
{
Connection con;
Statement st;
ResultSet rs;
[Link]("[Link]");
[Link]("test");
con=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]");
st=[Link]();
rs=[Link]("select SNAME from state");
[Link]("test");
while([Link]())
{
[Link]([Link]("SNAME"));
}
[Link]();
}
catch(Exception f)
{
[Link](f);
}
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {
54
dispose();
Page
SECTION:C2 A22205316002
});
setLayout(null);
setVisible(true);
setSize(500,500);
[Link]
(
new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
try { Connection conc;
Statement stc;
[Link]("[Link]");
[Link]("test");
conc=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]");
stc=[Link]();
String sc = [Link]();
String ss = [Link]([Link]());
stc=[Link]();
[Link]("Insert into city (SNAME,CNAME) values( '"+ss+"','"+sc+"')");
[Link]("sucessfully");
}
catch(Exception e)
{
55
[Link](e);
Page
SECTION:C2 A22205316002
}
}
}
);
}
public static void main(String args[])
{
new insc();
}
}
//Program to add village and fetch city and country
import [Link].*;
import [Link].*;
import [Link].*;
public class insv extends Frame implements ItemListener
{
Choice c1;
Choice c2;
TextField t1;
Button b1;
insv()
{
c1 = new Choice();
c2 = new Choice();
t1 = new TextField();
56
b1 = new Button("add");
Page
SECTION:C2 A22205316002
[Link](50,100,80,20);
[Link](150,100,80,20);
[Link](130,150,80,20);
[Link](130,250,80,20);
add(c1);
add(c2);
add(t1);
add(b1);
[Link](this);
try
{
Connection con;
Statement st,st2;
ResultSet rs,rs2;
[Link]("[Link]");
[Link]("test");
con=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]");
st=[Link]();
rs=[Link]("select SNAME from state");
[Link]("test");
while([Link]())
{
[Link]([Link]("SNAME"));
}
[Link]();
57
}
Page
catch(Exception f)
SECTION:C2 A22205316002
{
[Link](f);
}
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {
dispose();
}
});
setLayout(null);
setVisible(true);
setSize(500,500);
[Link]
(
new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
try {
Connection conc;
Statement stc;
[Link]("[Link]");
[Link]("test");
conc=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]");
stc=[Link]();
String sc = [Link]([Link]());
58
String ss = [Link]([Link]());
Page
SECTION:C2 A22205316002
String sv = [Link]();
stc=[Link]();
[Link]("Insert into village (SNAME,CNAME,VNAME) values(
'"+ss+"','"+sc+"','"+sv+"')");
[Link]("sucessfully");
[Link](" ");
[Link]();
}
catch(Exception e)
{
[Link](e);
}
}
}
);
}
public void itemStateChanged(ItemEvent ae)
{ [Link]();
String s = [Link]();
try{
Connection con2;
Statement st2;
ResultSet rs2;
[Link]("[Link]");
59
[Link]("test");
Page
SECTION:C2 A22205316002
con2=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]");
st2 = [Link]();
rs2 = [Link]("select CNAME from city where SNAME ='"+s+"'");
[Link]("city sucess");
while([Link]())
{
[Link]([Link]("CNAME"));
}
}
catch(Exception e)
{
[Link](e);
}
}
public static void main(String args[])
{
new insv();
}
}
60
Page
SECTION:C2 A22205316002
61
Page
SECTION:C2 A22205316002
Program to add and fetch the max roll no of the student from
database.
import [Link].*;
import [Link].*;
import [Link].*;
Label l1 ;
Label l2;
TextField un;
TextField pas;
Button b1;
Button b2;
Welcome w;
student()
{
l1=new Label("Rollno : ");
l2=new Label("student name : ");
un=new TextField();
pas=new TextField();
b1=new Button("OK");
b2=new Button("CANCEL");
[Link](50,50,80,20);
[Link](50,90,80,20);
[Link](150,50,80,20);
62
[Link](150,90,80,20);
Page
[Link](70,150,70,20);
SECTION:C2 A22205316002
[Link](170,150,70,20);
add(l1);
add(l2);
add(b1);
add(b2);
add(un);
add(pas);
try{
Connection conm;
Statement stm;
ResultSet rsm;
[Link]("[Link]");
[Link]("test");
conm=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]");
stm=[Link]();
rsm=[Link]("select MAX(R_no) from student") ;
while([Link]())
{
String rollm = [Link](1);
[Link](rollm);
}}
63
catch(Exception j)
Page
SECTION:C2 A22205316002
{
[Link](j);
}
setLayout(null);
setVisible(true);
setSize(500,500);
[Link]
(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
Connection con;
Statement st,st2;
ResultSet rs;
[Link]("[Link]");
[Link]("test");
con=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/[Link]
cdb");
[Link]("test");
st=[Link]();
String s1 = [Link]();
String s2 = [Link]();
st2=[Link]();
Page
SECTION:C2 A22205316002
while([Link]())
{
String roll = [Link](1);
Integer i = [Link](roll);
i++;
String f = [Link](i);
[Link](f);
[Link]("");
[Link]();
}
[Link]();
}
catch(Exception f)
{
[Link](f);
}
}
}
);
65
Page
SECTION:C2 A22205316002
}
66
Page
SECTION:C2 A22205316002
67
Page
SECTION:C2 A22205316002
Program to implement login validation using awt and database
import [Link].*;
import [Link].*;
import [Link].*;
class Welcome extends Frame
{
Welcome(String s1)
{
Label l1 =new Label();
setSize(250,250);
[Link](120,120,70,20);
[Link](" Welcome "+s1);
add(l1);
}
}
public class logindb extends Frame{
Label l1 ;
Label l2;
TextField un;
TextField pas;
Button b1;
Button b2;
Welcome w;
logindb()
{
l1=new Label("username : ");
l2=new Label("password : ");
68
un=new TextField();
Page
pas=new TextField();
SECTION:C2 A22205316002
b1=new Button("OK");
b2=new Button("CANCEL");
[Link]('$');
[Link](50,50,80,20);
[Link](50,90,80,20);
[Link](150,50,80,20);
[Link](150,90,80,20);
[Link](70,150,70,20);
[Link](170,150,70,20);
add(l1);
add(l2);
add(b1);
add(b2);
add(un);
add(pas);
setLayout(null);
setVisible(true);
setSize(500,500);
[Link]
(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
69
{
Page
Connection con;
SECTION:C2 A22205316002
Statement st;
ResultSet rs;
[Link]("[Link]");
[Link]("test");
con=[Link]("jdbc:ucanaccess://C:/Users/RAJA/Desktop/jdbc/access21.a
ccdb");
[Link]("test");
st=[Link]();
rs=[Link]("select * from user");
while([Link]())
{
if([Link]().equals([Link](2)));
{
setVisible(false);
w=new Welcome([Link](1));
[Link](true);
}
}
[Link]();
}
catch(Exception f)
{
[Link](f);
}
}
}
);
70
Page
SECTION:C2 A22205316002
[Link]
(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
dispose();
}});
}
71
Page
SECTION:C2 A22205316002
MAIL SYSTEM USING JSP
SIGN IN
72
Page
SECTION:C2 A22205316002
//html sign in page
<html>
<head>
<title>Signin</title>
</head>
<body>
<tr><td></td><td><a href="[Link]
</table>
</form>
</body>
</html>
//Index_action.jsp
<%!
String s1,s2,s4;
%>
<%
s1=[Link]("T6");
[Link]("sessname",s1);
s2=[Link]("T7");
73
Connection con=null;
Page
Statement st=null;
SECTION:C2 A22205316002
ResultSet rs=null;
try
[Link]("[Link]");
con=[Link]("jdbc:ucanaccess://C:/Program
Files/Apache Software Foundation/Tomcat 9.0_Tomcat/webapps/gopal/[Link]");
st=[Link]();
while([Link]())
s4=[Link]("password");
if([Link](s4))
[Link]("[Link]");
else
[Link]("[Link]");
catch(Exception e)
}
74
%>
Page
SECTION:C2 A22205316002
SIGN UP PAGE
75
Page
SECTION:C2 A22205316002
//HTML signup page
<html>
<head>
<title>Signup</title>
</head>
<body>
</table>
</form>
</body>
</html>
//Signup_action.jsp
<%!
String s1,s2,s3,s4,s5;
%>
<%
s1=[Link]("T1");
76
s2=[Link]("T2");
Page
s3=[Link]("T3");
SECTION:C2 A22205316002
s4=[Link]("T4");
s5=[Link]("T5");
%>
<%
Connection con=null;
PreparedStatement ps=null;
try{
[Link]("[Link]”);
[Link]();
catch(Exception e)
[Link]("[Link]");
%>
77
Page
SECTION:C2 A22205316002
HOME PAGE
78
Page
SECTION:C2 A22205316002
//HTML content of [Link]
<html>
<frameset rows=10%,*>
<frame src="Home_Top.jsp">
<frameset cols=*>
<frame src="Home_Left.jsp">
</frameset>
</frameset>
</html>
//Home_left.jsp
<html>
<body style="background-color:DodgerBlue;">
<tr><td><a href="[Link]
<%!
String s=null;
%>
<%
String name=(String)[Link]("sessname");
Connection con=null;
Statement st=null;
ResultSet rs=null;
try
[Link]("[Link]");
79
con=[Link]("jdbc:ucanaccess://C:/Program
Page
SECTION:C2 A22205316002
st=[Link]();
while([Link]())
s = [Link](1);
catch(Exception e)
%>
<tr><td><a
href="[Link]
<tr><td><a href="[Link]
<tr><td><a href="">Trash</a></td></tr>
</table>
</body>
</html>
//Home_Top.jsp
<html>
<body style="background-color:Tomato;">
<tr><td><h1>WELCOME:</h1></td><td><h1><%String name=(String)[Link]("sessname");
[Link](name);%></h1></td></tr>
</table>
80
</body>
Page
</html>
SECTION:C2 A22205316002
81
Page
SECTION:C2 A22205316002
Compose page
82
Page
SECTION:C2 A22205316002
//[Link]
<html>
<body>
<a href="[Link]
</table>
</form>
</body>
</html>
//compose_action.jsp
<html>
<body>
<%!
String s1,s2,s3,name,s4;
String[] s5;
%>
<%
name=(String)[Link]("sessname");
s1=[Link]("T10");
s2=[Link]("T11");
s3=[Link]("T12");
83
s4="unread";
Page
s5= [Link](",");
SECTION:C2 A22205316002
%>
<%
Connection con=null;
Statement st=null;
PreparedStatement ps,ps2;
try {[Link]("[Link]");
con=[Link]("jdbc:ucanaccess://C:/Program Files/Apache Software
Foundation/Tomcat 9.0_Tomcat/webapps/gopal/[Link]");
for(int i=0;i<[Link];i++)
{st=[Link]();
[Link](s5[i]);
[Link]();
[Link]();}
catch(Exception e)
%>
<tr><td><a href="[Link]
</table>
</body>
</html>
84
Page
SECTION:C2 A22205316002
SENT MAIL PAGE
85
Page
SECTION:C2 A22205316002
//[Link]
<html>
<body>
<form>
<a href="[Link]
<%!
String name;
%>
<%
name=(String)[Link]("sessname");
Connection con=null;
Statement st=null;
ResultSet rs=null;
try
[Link]("[Link]");
con=[Link]("jdbc:ucanaccess://C:/Program
Files/Apache Software Foundation/Tomcat 9.0_Tomcat/webapps/gopal/[Link]");
st=[Link]();
while([Link]())
86
Page
%>
SECTION:C2 A22205316002
<%[Link]("<tr><td>"+[Link]("To")+"</td><td>"+[Link]("Subject")+"</td><td><textarea
rows=5 cols=50 disabled>"+[Link]("Message")+"</textarea></td></tr><tr><td></td></tr>");%>
<%
[Link]("</table>");
catch(Exception e)
%>
</form>
</body>
</html>
87
Page
SECTION:C2 A22205316002
INBOX PAGE
88
Page
SECTION:C2 A22205316002
//Inbox_action.jsp
<html>
<body>
<%!
String name,s1,s2;
%>
<%
name=(String)[Link]("sessname");
s1="unread";
s2="read";
Connection con=null;
Statement st=null;
ResultSet rs=null;
try
[Link]("[Link]");
con=[Link]("jdbc:ucanaccess://C:/Program
Files/Apache Software Foundation/Tomcat 9.0_Tomcat/webapps/gopal/[Link]");
st=[Link]();
while([Link]())
{ %>
Page
SECTION:C2 A22205316002
<%[Link]("<tr><td><b><a
href=[Link]
/td><td>"+[Link]("Subject")+"</td></tr>");%>
<% } %>
<% if([Link](s2))
{ %>
<%
[Link]("<tr><td><a href=[Link]
[Link]("From")+"</a></td><td>"+[Link]("Subject")+"</td></tr>"); %>
[Link]("</table>");
catch(Exception e)
%>
</html>
</body>
90
Page
SECTION:C2 A22205316002
MESSAGE PAGE
91
Page
SECTION:C2 A22205316002
//[Link]
<html>
<body>
<%!
String name,s1,s2;
%>
<a href="[Link]
<%
s2=[Link]();
name=(String)[Link]("sessname");
s1="read";
Connection con=null;
Statement st=null;
ResultSet rs=null;
PreparedStatement ps;
try
[Link]("[Link]");
st=[Link]();
while([Link]())
{
92
String s3=[Link]("status");
Page
SECTION:C2 A22205316002
%>
<% if([Link](s3))
{%>
<%
}%> <%
[Link]("</table>");
Catch(Exception e)
[Link]();
[Link]();
</form>
</body>
</html>
//Message_delete.jsp
<html>
<body>
<%!
93
String s1,s2,s3;
Page
SECTION:C2 A22205316002
%>
<%
s1=[Link]("c1");
s2=[Link]("c2");
s3=[Link]("c3");
%>
<%
Connection con=null;
Statement st=null;
PreparedStatement ps,ps2;
try {
[Link]("[Link]");
[Link]();
[Link]("inbox_action.jsp");
catch(Exception e)
%>
</body>
</html>
94
Page
SECTION:C2 A22205316002