How To Create Java Project
How To Create Java Project
The application will enable a user to open an account with the bank.
The application will enable an account holder of the bank to register
to use the application.
The application will enable registered account holders to log on to the
banking web site after entering their login details.The banking
application will enable the account holders to view their account
details.The registered user also be able to modify any personal details
such as address or phone number.
The application will also provide utilities such as an interest
calculator and a foreign exchange calculator.
The application will also display the number of the hits on the
banking web site.
Welcome Page
Home Page
Login Page Registration Page For Registration Page For Interest Calculator
Account Holder Opening Account
Account
Details Update
databas
Update Database e
Login Page
An Introduction to Servlets:
Servlets are Java programs that can be deployed on a Java-
enabled Web server to enhance and extend the functionality of the server.
Client Server
Since servlets are written using java, all the features of Java library
classes are available to them.They can use Java API for tasks such
as networking and URL access, multithreading, database
connectivity, internationalization, remote method
invocation(RMI),and object serialization.
When the client sends a request to the server, the client can also pass
additional information with the URL to describe what exactly is required as
output from the server by using the GET and POST methods.
The request from the client to the server contains the following
information:
The difference between the GET and POST methods is that the
information, if any, sent with the request to the server is visible on the
browser while using the GET method. Therefore, sending requests to the
server by using the GET method can be risky.
To overcome this disadvantage, you can use the POST method to send
HTTP request to the server. The POST method sends the data as packets by
using a separate socket connection. When data is transferred in the form of
data packets, the data is hidden from the viewers. The disadvantage of
POST method is that it is slower than the GET method.
The page will also display a counter indicating the number of users who
have visited the site.The Welcome page uses servlets to display the number
of viewers who have visited the page.Since servlets have been used to
create the Welcome page.
An Introduction to JSP:
Java Server Pages (JSP) is a technology used to create dynamic
content on the Web. With the spread of the Internet and increasing number
of users registering with Web sites, the static pages developed using HTML
have became obsolete. Consider an example. A Web site displays a
Welcome message along with the name to the registered user when the user
logs on. Imagine that a static HTML page is developed for each user. In this
scenario, when a user logs on, the server looks for the HTML page of the
user and sends the page back to the client. If there are thousands of users,
the server will take considerable amount of time to search for a user’s
HTML page. Therefore, the disadvantages are delay in sending the
response; development time; and the increased probability of error. The
solution lies in using a dynamic Web page.
The database that you need will store the details of the account holders.
Therefore, you’ll name the database as AcHolder_Info table. The Design of
the table is given here:
Account_No Text
Register_ID Text
Balance Text
Account_Type Text
Branch Text
I’ve created the database and the table in MS Access and I’ll use this table
for database connectivity.
After creating the database, a DSN needs to be created.
You can create a DSN source by using the control panel. The steps to create
the DSN source are given here:
Class.forName (“sun.jdbc.odbc.JdbcOdbcDriver”);
The statement will load the JDBC-ODBC bridge driver. After loading the
driver, you need to establish the database connection.
<protocol>:<subprotocol>:<subname>
Connection con=DriverManager.getConnection(“jdbc.odbc.DSNname”,””,””);
Notice that the last two arguments of the getConnection() method are
blank. These arguments identify the username and the password to provide
connectivity to the database.
Current Accounts
Savings Accounts
Fixed Deposit
Recurring Deposit
Personal Loans
Home Loans
Consumer Loans
Auto Loans
Interest Calculator
Foreign Exchange Rates
Bank Branches
Contact Us
Log In
Registration Page for Account Holder
Registration Page for Non-Account Holder
The Output of the Home Page:
Check
Registratio
n
Display Error Message Update Database
Login Page
Login Page
Check
Login
Home Page
As the name suggests, the Login page of the online banking application at
Money Banks, Inc., will be used to accept and validate logon information
from the users. After validation, a user will be allowed to access the
application and perform transactions. The logon information generally
includes username and password. At Money Banks, the development team
decides to use the account number and password as logon information
because every account holder has a unique account number.
In this HTML page, two JavaScript methods have been used. These
methods are:
Check ()
home ()
Introduction about Java Script:
After all the fields are entered and the “View Account Details” button
is clicked the logon information is passed to the Login_page.jsp where it is
validating the database. On successful logon, the Login_page.jsp forwards
the request to the actDetails.jsp page.
The output of Login_page.jsp, showing Account
Details:
If the logon information matches the information in the database, the
request is forwarded to another JSP page, which is the actDetails.jsp. If the
user provides the incorrect information, the jsp page will not be forwarded.
Instead, the JSP page will again display the text boxes to accept logon
information from the user. The output of the unsuccessful logon page is
displayed below.
Valid
Registratio
n
In this code, there are three are three user defined JavaScript methods.
These methods are:
The JSP code receives the information from the HTML page and
updates the Database. The output of JSP code is displayed below.
Output of the JSP code got the page to
verify the details to open a new account at
Money Bank Inc:
Principle amount
Rate of interest
Period in Months
JavaBeans:
Java Bean is a software component created using Java and takes
advantage of all the security and platform independent features of Java.
• currExchange.htm
• currExchangeBean.jsp
• calc.java
The Login_Info Table will contain the logon information (such as the
password) about the account holders who have registered with the
application. The table structure is given below:
The Ac_Requests Table will hold the information of all the requests for
opening accounts at Money Banks. The Structure is given bellow.
AcHolder_Info Table
Interfaces Used
The Welcome Page
Software Specifications
Servlets
JSP
MS Access
JDBC
Tomcat6.0