Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2002): Can't connect to local server through socket '/var/lib/mysql/mysql.sock' (2) in /home/itprojectsco/public_html/includes/database.php on line 13
Ready Project |BCA Project | MCA Project | BBA Project | MBA Project |INDIA'S BIGGEST COLLEGE PROJECT STORE
<!DOCTYPE html>
<html>

<form method=get action="Slip12.jsp">
Enter Account No. : <input type=text name=ano>

Enter Account Type:<input type=text name=type>

Enter Balance : <input type=text name=bal>

<input type=submit value="Save">
/form>
</body></html>

Slip12.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html><body>
<%@ page import="java.sql.*;" %>
<%! int ano,bal;
String type; %>
<%
ano=Integer.parseInt(request.getParameter("ano"));
type=request.getParameter("type");
bal=Integer.parseInt(request.getParameter("bal"));
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn=DriverManager.getConnection("jdbc:odbc:acnt","","");
PreparedStatement s=cn.prepareStatement("insert into Account values(?,?,?)");
s.setInt(1,ano);

s.setString(2,type);
s.setInt(3,bal);
s.executeUpdate();
out.println("Record is saved");
Statement st=cn.createStatement();

ResultSet rs=st.executeQuery("select * from Account");
%>
<table border="1" width="40%">
<% while(rs.next())
{
%>
<tr><td><%= rs.getInt("ano") %></td>
<td><%= rs.getString("type") %></td>
<td><%= rs.getInt("bal") %></td>
</tr>
<%
}

cn.close();
}catch(Exception e)
{
out.println(e);
}
%>
</body>

Search

Project Categories


    Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/itprojectsco/public_html/includes/sidebar.php on line 30

    Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /home/itprojectsco/public_html/includes/sidebar.php on line 32

Recent Posts


Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/itprojectsco/public_html/includes/widget.php on line 5

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /home/itprojectsco/public_html/includes/widget.php on line 7

Sign In