Eleven Years of Service
Posts: 24
Threads: 8
Points: 0€
Java ebanking 02-23-2013, 04:46 PM
#1
Hi guys,i just wanted to ask, if someone has something related on ebanking with rmi on Java.I have to make on java a web banking program with rmi in my university. Thanking you in advance.
•
Eleven Years of Service
Posts: 24
Threads: 8
Points: 0€
Java ebanking 02-23-2013, 04:46 PM
#2
Hi guys,i just wanted to ask, if someone has something related on ebanking with rmi on Java.I have to make on java a web banking program with rmi in my university. Thanking you in advance.
•
Eleven Years of Service
Posts: 10
Threads: 2
Points: 0€
RE: Java ebanking 03-08-2013, 11:17 AM
#3
This Internet Banking Services System Project was developed with Java Programming and here executed code for Internet Banking System.
Find the below code and copy it as client section module.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class Client11 extends HttpServlet
{
String s1,s2,s3=""; int j;
String s4="",s5="",accno;
double amount,i;
Connection con;
public void init(ServletConfig sc)throws ServletException
{
super.init(sc);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:aravind","scott","tiger");
}catch(Exception e){ System.out.println(e);}
}
public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
s1= req.getParameter("user");
s2=req.getParameter("pwd");
try{
//accountno,usid,pwd,balance from transact where usid='"+s1+"'");
con.commit();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select USER_ID,PUBLIC_KEY,ACCNO,BALANCE from auser where user_id='"+s1+"'");
while(rs.next())
{
//System.out.println(s1); System.out.println(s2);
s3=rs.getString(1);
s4=rs.getString(2);
s5=rs.getString(3); //getString(3);
i=rs.getDouble(4);
/* System.out.println(" "+rs.getString(1));
System.out.println(" "+rs.getString(2));
System.out.println(" "+rs.getString(3));
System.out.println(" "+rs.getDouble(4)); */
}
// System.out.println(s3); System.out.println(s4);
if(s3.equals(s1)&&s4.equals(s2))
{
System.out.println(s3); System.out.println(s4);
Cookie uname=new Cookie("user",s1);
Cookie uaccno=new Cookie("acc",s5);
pw.println("
<center>");
pw.println("</center>
<h2><span style="text-decoration: underline;"><strong><em>WELCOME TO BANKING</em></strong></span></h2>
");
pw.println("<a href="http://localhost:8080/aboutus.html">");
pw.println("<img src="http://localhost:8080/home2[1].gif" alt="" align="right" /></a>");
pw.println("");
pw.println("
");
pw.println("
<h3><em><strong>STATEMENT</strong></em></h3>
");
pw.println("
<center>");
pw.println("
"); pw.println("");
pw.println("
");
pw.println("<a href="http://localhost:8080/servlet/Client3" target="_top">Transaction</a>");
//transaction2
pw.println("
");
pw.println(" <a href="http://localhost:8080/usermanager.html">UserManager</a>");
pw.println("
<a href="http://localhost:8080/logout.html" target="_top">Logout</a>");
pw.println("</center>
<table border="22" bgcolor="yellow">
<tbody>
<tr>
<td align="center">");
pw.println("<a href="http://localhost:8080/statement.html">Statement</a></td>
</tr>
</tbody>
</table>
");
pw.println("
<form><center>
<pre>Name :<input type="text" name="t1" value="+s3+" disabled="disabled" size="20" />");
pw.println("Account No"+"<input type="text" name="t2" value="+s5+" disabled="disabled" size="20" />
");
pw.println("</pre>
<h4>The Balance in Your Account is RS :"); pw.println("<input type="text" name="t3" value="+i+" disabled="disabled" />"); pw.println("</h4>
</center><center>");
//pw.println("<input type="button" name="b1" value="statement" />");
//pw.println("<input type="button" name="b2" value="Query" />");
pw.println("
</center></form>");
res.addCookie(uname);
res.addCookie(uaccno);
}
else
{
res.sendRedirect("http://localhost:8080/invalid1.html");
}
//System.out.println(s3);
}catch(Exception e1){ System.out.println(e1);}
}
}
•