Professional Documents
Culture Documents
1
Title of the Project: Mobile Banking.
Problem Definition:
Mobile Banking refers to provision of banking- and
financial services with the help of mobile telecommunication devices. The scope of
offered services may include facilities to conduct bank transactions, to administer
accounts and to access customized information.
Objective:
• Customer Service provision so as to make it easier for him to check his
basic account information.
• Anytime, anywhere facility to access his bank account information.
Scope:
Mobile Web applications enable users on the move to access date on their hand
held devices. The various applications built in the project are as follows: Check Balance,
Check status, Fund transfer, Loan status, Locker status and Deposit Details.
Due to it’s Anytime, Anywhere, And Anyplace offerings customers will be able
to access their bank accounts when and wherever they want thus saving their time and
money. They would not be required to travel to the location of their account and carry out
transaction there instead all the banking transactions will be carried out on the mobile
handset itself. This facility is now limited to a particular branch or a particular bank but
in future it can be used to implement banking transactions over accounts belonging to
different banks. The project will be a global success if all the security issues are properly
taken care of and tested for its wide range functionality and implemented accordingly.
Functions:
• Take user information through a jar file loaded on his cell phone.
• Activated General Packet Radio Service (GPRS) connection will allow the
user to send request to the Web server.
2
• Web Server responses by processing the servlet which retrieves
information from the database for the user.
Constraints:
• The user should have a cellphone which connects to the internet.
• The user should have java enabled cellphone.
Methodology:
Hardware Requirements:
• Pentium 3- 800 MHZ
• 256 MB RAM
• GPRS enabled mobile phones
Software Requirements:
• Tomcat server
• Java Wireless toolkit
• Windows Operating System
• Ms-Access
3
Literature
Survey
4
Basic concept and its origin:
Banking:
Banks borrow money by accepting funds deposited on current account, accepting term
deposits and by issuing debt securities such as banknotes and bonds. Banks lend money
by making advances to customers on current account, by making installment loans, and
by investing in marketable debt securities and other forms of lending.
Banks provide almost all payment services, and a bank account is considered
indispensable by most businesses, individuals and governments.
Banks offer many different channels to access their banking and other services:
5
• Telephone banking is a service provided by a financial institution which allows its
customers to perform transactions over the telephone. This normally includes bill
payments for bills from major bill payers. (E.g. for electricity).
• Online banking is a term used for performing transactions, payments etc. over the
Internet through a bank, credit union or building society's secure website.
Online Banking:
6
all of their accounts in one place whether they are with their main bank or with
other institutions...
Mobile Web:
The Mobile Web refers to the World Wide Web as accessed from mobile devices
such as cell phones, PDAs, and other portable gadgets connected to a public network.
Access does not require a desktop computer.
However, Mobile Web access today still suffers from interoperability and usability
problems. This is partly due to the small physical size of the screens of mobile devices
and partly due to the incompatibility of many mobile devices with not only computer
operating systems, but also the format of much of the information available on the
Internet.
New tools such as Macromedia's Flash Lite or Sun's J2ME enable the production of
user interfaces customized for mobile devices.
GPRS:
GPRS can be used for services such as Wireless Application Protocol (WAP)
access, Short Message Service (SMS), Multimedia Messaging Service (MMS), and for
Internet communication services such as email and World Wide Web access.
WAP is just a gateway used to access Internet via mobile phone and vice-versa.
Theoretical Analysis:
The advent of the Internet has revolutionized the way the financial
services industry conducts business, empowering organizations with new business
models and new ways to offer 24x7 accessibility to their customers.
The ability to offer financial transactions online has also created new players in the
financial services industry, such as online banks, online brokers and wealth managers
who offer personalized services, although such players still account for a tiny percentage
of the industry.
7
Over the last few years, the mobile and wireless market has been one of the fastest
growing markets in the world and it is still growing at a rapid pace. According to the
GSM Association and Ovum, the number of mobile subscribers exceeded 2 billion in
September 2005, and now exceeds 2.5 billion (of which more than 2 billion are GSM).
Many believe that mobile users have just started to fully utilize the data capabilities in
their mobile phones. In Asian countries like India, China, Indonesia and Philippines,
where mobile infrastructure is comparatively better than the fixed-line infrastructure, and
in European countries, where mobile phone penetration is very high (at least 80% of
consumers use a mobile phone), mobile banking is likely to appeal even more.
This opens up huge markets for financial institutions interested in offering value added
services. With mobile technology, banks can offer a wide range of services to their
customers such as doing funds transfer while traveling, receiving online updates of stock
price or even performing stock trading while being stuck in traffic. According to the
German mobile operator Mobilcom, mobile banking will be the "killer application" for
the next generation of mobile technology.
Mobile devices, especially smartphones, are the most promising way to reach the masses
and to create “stickiness” among current customers, due to their ability to provide
services anytime, anywhere, high rate of penetration and potential to grow. According to
Gartner, shipment of smartphones is growing fast, and should top 20 million units (of
over 800 million sold) in 2006 alone.
In the last 4 years, banks across the globe have invested billions of dollars to build
sophisticated internet banking capabilities. As the trend is shifting to mobile banking,
there is a challenge for CIO’s and CTO’s of these banks to decide on how to leverage
their investment in internet banking and offer mobile banking, in the shortest possible
time.
Mobile Banking is a concept that was developed thinking about the fact that
8
Mobile handsets are a common commodity today and are found to be affordable to the
common man. I realized that how easy it would be to carry out banking transactions if
they were carried out from the mobile handset itself.
I started the research 2 months prior to going along with the project which
involved getting acquainted with the variety of banking operations and also the working
of web and wireless operations.
For my research work, I consulted various banking officials and found out what
are the various banking operations that could be implemented using the mobile handset.
I tried to find out about the practicality of the project by studying the implementations of
the web and wireless applications. I did my research regarding which all sectors of
banking could be implemented using our project. Also the research involved learning
about various software’s available that could be used to implement my project and I
studied the operation of the various mobile emulators for the same.
The idea that mobile phones bring economic benefits is now widely accepted. In
places with bad roads, few trains and parlous land lines, they substitute for travel, allow
price data to be distributed more quickly and easily, enable traders to reach wider markets
and generally ease the business of doing business.
With mobile banking, the customer may be sitting in any part of the world (a true
anytime, anywhere banking) and hence banks need to ensure that the systems are up and
running in a true 24 x 7 fashion.
Mobile banking will be attractive mainly to the younger, more "tech-savvy"
customer segment. A third of mobile phone users say that they may consider performing
some kind of financial transaction through their mobile phone. Most of the users are
interested in performing basic transactions such as querying for account balance and
making bill payment.
9
Design and
Implementa
tion
10
Functional Design:
Tomcat
User GPRS
Server
(Mobile
device)
Servlet
Servlet
Engine
Service
Bank
Provider
Database
Database
11
Data Flow Diagrams (DFD):
Access
12
User Request Gets Status
Bank DataBase
Fig 02: Level 1.1 DFD
13
User Request Gets Status
Locker
Login
Status
User Request
Gets Status
14
Deposit
Login
Status
User Request
Gets Status
Loan
Login
Status
User Request
Gets Status
15
Bill
Login Payment
User Request Status
Gets Status
Bank DataBase
Service ProviderDataBase
Data Dictionary:
Table :01 Customer
16
Account _no Text 05 Not null
Table: 02 Cheque_status
Account_no text 05 Not null
Deposit_date Date - -
Table:04 Locker_status
17
Account_no Text 05 Not null
Table :05:DepStat
Account_no Text 05 Not null
Table:06 Login
18
ER DIAGRAM:
19
Name Addr Phno Do
Balanc e
Gender Mobile s
e
Acc_typ
CUSTOMER Acc_N
e
Acc_n o
Credit
o Transfer
Debit
Cust_i
To_Accnt
d amt
Ch
ec
ks
M
Pa ake
ym s
en date
t Servivce Bill
Acc_N
Due_Date
o
Bill amt
Provider Acc
Acc_N
o
Cust_No Bill amt
Fig10: ER Diagram
Relational Tables:
20
Customer:
21
Deposit Status (DepStat):
Login:
Hippo Chart:
22
J2ME
Login
From and
to acc no Display
Display Display Display Display
Locker
Balance Status Loan Due Deposit
Status
Status
Basic Algorithms/Procedures/Methods/Logic:
23
The project is an integration of Web (J2EE) and Mobile (J2ME) technology.
Hence the basic logic is to find a solution which would provide customer the basic
services from bank using these two technologies together.
J2ME:
Java Platform, Micro Edition (Java ME) provides a robust, flexible environment
for applications running on mobile and other embedded devices—mobile phones,
personal digital assistants (PDAs), TV set-top boxes, and printers. Java ME includes
flexible user interfaces, robust security, built-in network protocols, and support for
networked and offline applications that can be downloaded dynamically. Applications
based on Java ME are portable across many devices, yet leverage each device's native
capabilities.
J2EE:
Java EE is defined by its specification. As with other Java Community Process
specifications, Java EE is also considered informally to be a standard since providers
must agree to certain conformance requirements in order to declare their products as Java
EE compliant; albeit with no ISO or ECMA standard.
Java EE also features some specifications unique to Java EE for components.
These include Enterprise JavaBeans, servlets, portlets (following the Java Portlet
specification), JavaServer Pages and several web service technologies. This allows
developers to create enterprise applications that are portable and scalable, and that
integrate with legacy technologies. A Java EE "application server" can handle the
transactions, security, scalability, concurrency and management of the components that
are deployed to it, meaning that the developers can concentrate more on the business
logic of the components rather than on infrastructure and integration tasks.
Description of Algorithms/Procedures/Methods/Logic:
24
Java ME has become a popular option for creating applications and games for cell
phones, as they can be emulated on a PC during the development stage and easily
uploaded to phones. This contrasts with the difficulty of developing, testing, and loading
applications and gaming for other special gaming platforms such as those made by
Nintendo, Sony, Microsoft, and others, as expensive system-specific hardware and kits
are required.
Java ME devices implement a profile. The most common of these are the Mobile
Information Device Profile aimed at mobile devices, such as cell phones, and the
Personal Profile aimed at consumer products and embedded devices like Set-top boxes
and PDAs.Profiles are subsets of configurations, of which there are currently two: the
Connected Limited Device Configuration and the Connected Device Configuration.
CLDC:
The Connected Limited Device Configuration (CLDC) defines the base set of
application programming interfaces and a virtual machine for resource-constrained
devices like mobile phones, pagers, and mainstream personal digital assistants. When
coupled with a profile such as the Mobile Information Device Profile (MIDP), it provides
a solid Java platform for developing applications to run on devices with limited memory,
processing power, and graphical capabilities.
• javax.microedition.midlet
The MIDlet package defines Mobile Information Device Profile applications and
the interactions between the application and the environment in which the
application runs. An application of the Mobile Information Device Profile is a
MIDlet.
25
• javax.microedition.lcdui
The UI API provides a set of features for implementation of user interfaces for
MIDP applications.
Java Platform, Enterprise Edition (Java EE) builds on the solid foundation of Java
Platform, Standard Edition (Java SE) and is the industry standard for implementing
enterprise-class service-oriented architecture (SOA) and next-generation web
applications.
26
Java Platform, Enterprise Edition (Java EE) is a set of coordinated technologies
that significantly reduces the cost and complexity of developing, deploying, and
managing multitier, server-centric applications. Building on the Java Platform, Standard
Edition (Java SE), Java EE adds the capabilities that provide a complete, stable, secure,
and fast Java platform for the enterprise.
• javax.servlet :
• java.sql:
27
Provides the API for accessing and processing data stored in a data source
(usually a relational database) using the Java programming language. This API
TM
passing SQL statements to a database, it provides for reading and writing data
from any data source with a tabular format. The reader/writer facility, available
through the javax.sql.RowSet group of interfaces, can be customized to use and
update data from a spread sheet, flat file, or any other tabular data source.
• java.io
Provides for system input and output through data streams, serialization
and the file system. Unless otherwise noted, passing a null argument to a
constructor or method in any class or interface in this package will cause a
NullPointerException to be thrown.
• java.util
Provides for system input and output through data streams, serialization
and the file system. Unless otherwise noted, passing a null argument to a
constructor or method in any class or interface in this package will cause a
NullPointerException to be thrown.
28
User Manual
29
About software:
The user would be provided with an executable jar file which
would help him connect the web server to get the required service.
In Simulation Model:
User End:
a. Open the Java wireless toolkit.
b. Select MBS as the project.
c. Build and Run it.
d. Login with the correct username and password.
e. Select the service required and get the reply from
the provider.
In Real-Life Model:
User End:
a. Run the jar file on a mobile phone which supports
java.
b. Log in with a correct username and password to
access the services provided.
c. After logging in, select the required service.
30
Importance of the project:
The idea that mobile phones bring economic benefits is now widely accepted. In
places with bad roads, few trains and parlous land lines, they substitute for travel, allow
price data to be distributed more quickly and easily, enable traders to reach wider markets
and generally ease the business of doing business.
With mobile banking, the customer may be sitting in any part of the world (a true
anytime, anywhere banking) and hence banks need to ensure that the systems are up and
running in a true 24 x 7 fashion.
31
Further
Enhancemen
t
32
M-banking schemes can be combined with microfinance loans, extending access to credit
and enabling users to establish a credit history
Account Information
Mobile recharging
Investments
33
Personalized alerts and notifications on security prices
Support
Status of requests for credit, including mortgage approval, and insurance coverage
Exchange of data messages and email, including complaint submission and tracking
ATM Location
Content Services
Loyalty-related offers
Location-based services
34
Appendix
Source Code:
MBS.java:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class MBS extends MIDlet
{
String sn=null;
MLogin mlogin;
CheckBal chkbal;
CheqStat chqstat;
DepDet depdet;
FundTran fundtran;
LoanStat loanstat;
LockStat lockstat;
MainMenu mm;
public MBS()
35
{
mlogin = new MLogin(this);
chkbal = new CheckBal(this);
chqstat = new CheqStat(this);
depdet = new DepDet(this);
fundtran = new FundTran(this);
loanstat = new LoanStat(this);
lockstat = new LockStat(this);
mm=new MainMenu(this);
}
public void mlogin()
{
Display.getDisplay(this).setCurrent(mlogin);
}
public void chkbal()
{
Display.getDisplay(this).setCurrent(chkbal);
}
public void chqstat()
{
Display.getDisplay(this).setCurrent(chqstat);
}
public void depdet()
{
Display.getDisplay(this).setCurrent(depdet);
}
36
{
Display.getDisplay(this).setCurrent(mlogin);
}
public void pauseApp()
{
}
public void destroyApp(boolean b)
{
}
public void quit()
{
destroyApp(false);
notifyDestroyed();
}
public String callServlet(String servname,String param,String disp)
{
String response="Error";
ConnectWait cw=new ConnectWait(this,disp);
response=cw.callServlet(servname,param);
return response;
}
};
MainMenu.java:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
37
append("Check Balance",null);
append("Check Cheque Status",null);
append("Check Deposit Status",null);
append("Perform Fund Transfer",null);
append("Check Loan Due",null);
append("Check Locker Status",null);
setCommandListener(this);
}
{
Display.getDisplay(mbs).setCurrent(mbs.mlogin);
mbs.mlogin.tfuser.setString("");
mbs.mlogin.tfpwd.setString("");
}
}
}
Mlogin.java:
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
38
private Command login,exit;
TextField tfuser,tfpwd;
private String response,sn,sp;
private StringItem si;
super("Login form");
this.mbs=mbs;
append(si);
append(tfuser);
append(tfpwd);
addCommand(login);
addCommand(exit);
setCommandListener(this);
}
39
{
Display.getDisplay(mbs).setCurrent(new
Alert("Error", "You have not entered Loginname", null, AlertType.ERROR));
}
else if(sp.equals(""))
{
Display.getDisplay(mbs).setCurrent(new
Alert("Error", "You have not entered Password", null, AlertType.ERROR));
}
else
{
String sname="MLogin";
String
sparam="LoginName="+sn+"&Password="+sp;
String
res=mbs.callServlet(sname,sparam,"Logging in....");
char d=res.charAt(0);
if(!res.equals("Error"))
{
if(d=='W')
{
mbs.sn=tfuser.getString();
mbs.mm();
}
else
{
tfpwd.setString("");
LockStat.java:
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
40
public class LockStat extends Form implements CommandListener
{
private MBS mbs;
private TextField tflockno;
private Command getlkstat,back;
private String response,lc;
private Form disp;
private StringItem dsi;
append(tflockno);
addCommand(getlkstat);
addCommand(back);
setCommandListener(this);
41
Display.getDisplay(mbs).setCurrent(new Alert("Error",
"Please Enter a 5 digit Number", null, AlertType.ERROR));
}
else if(lc.length()>5)
{
Display.getDisplay(mbs).setCurrent(new Alert("Error",
"The Locker Number Should be 5 digits only ", null, AlertType.ERROR));
}
else
{
String sname="MLockStat";
String sparam="lockid="+lc;
String res=mbs.callServlet(sname,sparam,"Locker
Status....");
dsi.setText(res);
Display.getDisplay(mbs).setCurrent(disp);
}
}
if (comm == back)
{
Display.getDisplay(mbs).setCurrent(mbs.mm);
tflockno.setString("");
}
}
}
LoanStat.java:
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
42
this.mbs=mbs;
append(tfloanno);
addCommand(getlnstat);
addCommand(back);
setCommandListener(this);
43
dsi.setText(res);
Display.getDisplay(mbs).setCurrent(disp);
}
}
if (comm == back)
{
Display.getDisplay(mbs).setCurrent(mbs.mm);
tfloanno.setString("");
}
}
}
FundTran:
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
append(tfrtoacc);
append(tframt);
addCommand(tfrfund);
addCommand(back);
setCommandListener(this);
disp=new Form("Transfer Info");
44
dsi=new StringItem("","");
disp.append(dsi);
disp.addCommand(back);
disp.setCommandListener(this);
}
{
Display.getDisplay(mbs).setCurrent(new
Alert("Error", "You have not entered Amount", null, AlertType.ERROR));
}
else
{
int toamt=Integer.parseInt(amt);
String sname="MFundTran";
String
sparam="faccn="+sn+"&famt="+toamt;
String
res=mbs.callServlet(sname,sparam,"Fund Transfer Screen");
dsi.setText(res);
Display.getDisplay(mbs).setCurrent(disp);
}
}
if (comm == back)
45
{
Display.getDisplay(mbs).setCurrent(mbs.mm);
tfrtoacc.setString("");
tframt.setString("");
}
}
}
DepDet.java:
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
append(tfdepno);
addCommand(getdepdet);
addCommand(back);
setCommandListener(this);
46
disp.setCommandListener(this);
}
}
else if(ndep.length()>6)
{
Display.getDisplay(mbs).setCurrent(new Alert("Error",
"Deposit Number is too Long ", null, AlertType.ERROR));
}
else
{
String sname="MDepDet";
String sparam="depno="+ndep;
String res=mbs.callServlet(sname,sparam,"Deposit
Details....");
dsi.setText(res);
Display.getDisplay(mbs).setCurrent(disp);
}
}
if (comm == back)
{
Display.getDisplay(mbs).setCurrent(mbs.mm);
tfdepno.setString("");
}
}
}
47
ConnectWait.java:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.*;
import javax.microedition.io.*;
ConnectWait(MBS mbs)
{
this.mbs=mbs;
msg = "Please Wait...";
repaint();
serviceRepaints();
}
48
Thread t = new Thread(this);
t.start();
try
{
t.join();
}
catch(InterruptedException e)
{
response="Error";
}
if(response.equals("Error"))
Display.getDisplay(mbs).setCurrent(new Alert("Sorry", "Error in
Connection. Try Later", null, AlertType.ERROR));
return response;
}
http=(HttpConnection)Connector.open(servbase+servname+"?"+param);
System.out.println("2");
http.setRequestMethod(HttpConnection.GET);
System.out.println("3");
http.setRequestProperty("Content-Type","application/x-www-
form-urlencoded");
System.out.println("4");
// Get Response
is=http.openInputStream();
System.out.println("5");
ByteArrayOutputStream baos=new ByteArrayOutputStream();
System.out.println("6");
int ch;
while((ch=is.read())!=-1)
{
baos.write(ch);
}
String str=new String(baos.toByteArray());
baos.close();
49
response=str.trim();
}
catch(IOException e)
{
response="Error";
}
finally
{
try { if(http!=null) http.close(); } catch(IOException ignored)
{}
try { if(is!=null) is.close();} catch(IOException ignored) {}
}
}
};
CheqStat.java:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import java.io.*;
50
super("Cheque Information");
this.mbs=mbs;
append(tfchqstat);
addCommand(check);
addCommand(back);
setCommandListener(this);
51
String sparam="cno="+sno;
String
res=mbs.callServlet(sname,sparam,"Cheque Status....");
dsi.setText(res);
Display.getDisplay(mbs).setCurrent(disp);
}
}
if(comm == back)
{
Display.getDisplay(mbs).setCurrent(mbs.mm);
tfchqstat.setString("");
}
}
}
CheckBal.java:
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
append(accno);
addCommand(getbal);
addCommand(back);
setCommandListener(this);
52
disp=new Form("Bal Info");
dsi=new StringItem("","");
disp.append(dsi);
disp.addCommand(back);
disp.setCommandListener(this);
}
53
if (comm==back)
{
Display.getDisplay(mbs).setCurrent(mbs.mm);
accno.setString("");
}
}
}
Bank.java
MLogin.java:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
54
res.setContentType("text/html");
out = res.getWriter();
ServletContext context= getServletContext();
l = req.getParameter("LoginName");
p = req.getParameter("Password");
try
{
DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());
c=DriverManager.getConnection(Bank.getDsn());
s = c.createStatement();
rs=s.executeQuery("select * from Login where LoginName
='"+l+"' and Password='"+p+"'");
if(rs.next())
{
out.println("Welcome to Mobile Banking System ,"+l+"");
context.setAttribute("Accno",rs.getString("Acc_no"));
}
else
{
out.println("Invalid Login/Password.");
}
}
catch(Exception e)
{
out.println("Error"); }
finally
{
try
{
if(c!=null) c.close();
}
catch(SQLException igno)
{
}
}
}
55
MCheckBal.java:
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
56
else
{
out.println("Invalid Account Number.Please Enter Proper
Account Number.");
}
}
catch(Exception e)
{
//e.getMessage();
System.out.println("ERROR");
}
finally
{
try
{
if(c!=null) c.close();
}
catch(SQLException igno)
{
}
}
}
}
MCheqStat.java:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class MCheqStat extends HttpServlet
{
String acn,ckno,amt,d,sss;
java.util.Date dep,ds;
StringTokenizer st;
Connection c,con;
Statement s,s1;
ResultSet rs,rs1,rs2;
PrintWriter out;
int diff;
public void doGet(HttpServletRequest req,HttpServletResponse res) throws
ServletException, IOException
57
{
doPost(req,res);
}
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
ServletException, IOException
{
ServletContext context=getServletContext();
res.setContentType("text/html");
out=res.getWriter();
ckno=req.getParameter("cno");
ds=new java.util.Date();
try
{
DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());
c=DriverManager.getConnection(Bank.getDsn());
con=DriverManager.getConnection(Bank.getDsn());
s=c.createStatement();
s1=con.createStatement();
int cckno=Integer.parseInt(ckno);
rs=s.executeQuery("select * from Chqstatus where
Chqno="+cckno+"");
String sameacc= (String)context.getAttribute("Accno");
if (rs.next())
{
acn=rs.getString("Acc_no");
int amtn=rs.getInt("Amt");
String deps=(rs.getDate("Depdate")).toString();
st = new StringTokenizer(deps,"-");
String y=st.nextToken();
String m=st.nextToken();
String da=st.nextToken();
int i1=Integer.parseInt(y);
int i2=Integer.parseInt(m);
int i3=Integer.parseInt(da);
dep=new java.util.Date(i1-1900,i2-1,i3);
diff=(ds.getDate()-dep.getDate());
58
{
out.println("Your Cheque dated "+dep+" has been
presented for Clearance");
}
else
if ((diff>=3) && (i2==ds.getMonth()+1) &&
(i1==ds.getYear()+1900) )
{
String acnd=rs.getString("Acc_no");
rs1=s.executeQuery("select * from
Customer where Acc_no='"+acnd+"'");
rs2=s1.executeQuery("select * from
Chqstatus where Chqno="+cckno+"");
if (rs2.next())
{
sss=rs2.getString("Stat");
}
(rs1.next() && (!sss.equalsIgnoreCase("Cleared")) )
{
out.println("Your
Cheque dated "+dep+"has been Cleared ");
out.println("The
amount credited to your account is :"+amtn+"");
int
cre=rs1.getInt("Credit");
int
bal=rs1.getInt("Balance");
int ncre=amtn+cre;
int nbal=amtn+bal;
String cs="Cleared";
}
else
59
{
out.println(" Check Account Number or Cheque
Number.. ");}
}
else
{
out.println("Invalid Data Entry ");
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
// e.printStackTrace();
}
finally
{
try
{
if(c!=null) c.close();
if(con!=null) con.close();
}
catch(SQLException igno)
{
}
}
}
}
MDepDet.java:
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
60
public void doGet(HttpServletRequest req,HttpServletResponse res) throws
ServletException, IOException
{
doPost(req,res);
}
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
ServletException, IOException
{
res.setContentType("text/html");
out=res.getWriter();
dep=req.getParameter("depno");
try
{
DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());
c=DriverManager.getConnection(Bank.getDsn());
s=c.createStatement();
if (rs.next())
{
java.util.Date depd=rs.getDate("Idate");
String id=rs.getString("Deposit_no");
String mats=(rs.getDate("Mdate")).toString();
st=new StringTokenizer(mats,"-");
String y=st.nextToken();
String m=st.nextToken();
String da=st.nextToken();
int y1=Integer.parseInt(y);
int m1=Integer.parseInt(m);
int da1=Integer.parseInt(da);
depmd=new java.util.Date(y1-1900,m1-1,da1);
ds=new java.util.Date();
c1= depmd.before(ds);
if ((id.equalsIgnoreCase(dep)) &&
(c1==true) )
61
{
out.println("Investment
Dated "+depd+" has matured.");
out.println("The Maturity
Amount is :"+rs.getInt("Maturedamt")+" @ "+rs.getInt("RateofInterest") + " for a period
of "+rs.getInt("Period")+" months");
}
else
{
out.println("Your Deposit's are yet
to Mature.");
}
}
else
{
out.println("Check the Deposit Number");
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
finally
{
try
{
if(c!=null) c.close();
}
catch(SQLException igno)
{
}
}
}
MFundTran.java:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
62
{
String fac,fam;
Connection c;
Statement s;
ResultSet rs,rs1;
PrintWriter out;
int ideb,ibal;
fac=req.getParameter("faccn");
fam=req.getParameter("famt");
int ifam=Integer.parseInt(fam);
try
{
DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());
c=DriverManager.getConnection(Bank.getDsn());
s = c.createStatement();
boolean b=sameacc.equalsIgnoreCase(fac);
if (b==false && ibal>ifam)
63
{
rs=s.executeQuery("select * from Customer
where Acc_no='"+fac+"'");
if (rs.next())
{
int cre=rs.getInt("Credit");
int bal=rs.getInt("Balance");
int ncre=ifam+cre;
int nbal=ifam+bal;
int ndeb=ifam+ideb;
int nbalan=ibal-ifam;
s.executeUpdate("update Customer
set Credit="+ncre+", Balance="+nbal+" where Acc_no='"+fac+"'");
s.executeUpdate("update Customer
set Debit="+ndeb+", Balance="+nbalan+" where Acc_no='"+sameacc+"'");
}
else
{
}
}
else
{
out.println("You Can't Transfer Money to
your own account");
out.println("Or You don't have sufficient
funds to perform transfer");
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
finally
64
{
try
{
if(c!=null) c.close();
}
catch(SQLException igno)
{
}
}
}
}
MLoanStat.java:
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
65
c=DriverManager.getConnection(Bank.getDsn());
s=c.createStatement();
rs=s.executeQuery("select * from loanstat where
Loanid='"+lid+"'");
if (rs.next())
{
int z=rs.getInt("Dueamt");
if (z==0)
out.println("All your loan is paid ");
else
out.println("Your Loan Status i.e. due amount
is:"+"RS."+z+"");
}
else
{
out.println(" Invalid Entry or no due amount left");
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
finally
{
try
{
if(c!=null) c.close();
}
catch(SQLException igno)
{
}
}
}
}
MLockStat.java:
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
66
public class MLockStat extends HttpServlet
{
String lac,lcid,i;
Connection c;
Statement s;
ResultSet rs,rs1;
PrintWriter out;
lcid=req.getParameter("lockid");
try
{
DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());
c=DriverManager.getConnection(Bank.getDsn());
s=c.createStatement();
rs=s.executeQuery("select * from Locker where
Lock_id='"+lcid+"'");
if (rs.next())
{
int r=rs.getInt("Ramt");
if (r==0)
out.println(" Your Rent for this year is Paid...");
else
out.println(" Your Rent Amount "+r+" is to be
paid");
}
else
{
out.println(" Invalid Entry..Please check your Locker
Number.. ");
}
67
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
Screenshots:
68
69
70
71
72
73
74
75
Bibliography
Books:
References:
• www.java.sun.com
• www.developer.sun.com
• www.activeexperts.com
• www.j2me.org
76