Professional Documents
Culture Documents
Vasavi College of Engineering
Vasavi College of Engineering
Vasavi College of Engineering
</body>
</html>
package in.ac.vce;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UploadBean
{
private int hno;
private String name;
Connection con;
PreparedStatement ps;
public void UploadBean()
{
}
public void setHno(int hno)
{
this.hno=hno;}
public void setName(String name)
{this.name=name;}
public int getHno()
{return this.hno;}
public String getName()
{return this.name;}
public void setStoreDatabase(String n)
{
try {
Class.forName("oracle.jdbc.OracleDriver");
String url="jdbc:oracle:thin:@135.135.4.22:1521:rdbms";
con=DriverManager.getConnection(url,"cse14733002","vasavi");
System.out.println("JDBCDemo.main() connected");
ps=con.prepareStatement("insert into biodata values(?,?)");
ps.setInt(1,hno);
ps.setString(2,name);
int r=ps.executeUpdate();
}
catch(Exception e)
{
e.printStackTrace();
}}}
VASAVI COLLEGE OF ENGINEERING
(Affiliated to Osmania University)
Hyderabad - 500 031.
DEPARTMENT OF : Computer Science and
engineering
NAME OF LABORATORY : Web Programming and
Networking
Name Roll No.
Page No
Index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Login</title>
</head>
<body>
Login<br>
<form action="validate.jsp" method="post">
UserName:<input type="text" name="username"/></br>
Password:<input type="text" name="password"/></br>
<input type="submit" value="submit"/>
</form>
</body>
</html>
Welcome.html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Welcome
</body>
</html>
<jsp:forward page="welcome.html"></jsp:forward>
<%
} else {
%>
<b style="color: red">Login failed</b>
<jsp:include page="index.html"></jsp:include>
<%
}
%>
</body>
</html>
Error.jsp
String num1=request.getParameter("n1");
String num2=request.getParameter("n2");
int a=Integer.parseInt(num1);
int b=Integer.parseInt(num2);
int c=a/b;
out.print("division of numbers is: "+c);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
</body>
</html>
VASAVI COLLEGE OF ENGINEERING
(Affiliated to Osmania University)
Hyderabad - 500 031.
DEPARTMENT OF : Computer Science and
engineering
NAME OF LABORATORY : Web Programming and
Networking
Name Roll No.
Page No