Professional Documents
Culture Documents
A PROJECT REPORT
Submitted by
Ritesh Kumar
In partial fulfillment for the award of the degree
Of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE
www.hclinfosystems.in
Acknowledgement
Preface
Banker database system is an application which uses a database to perform bank
transactions, enables creating new accounts along with their initial balance,
withdrawing or depositing to an account and also displaying the account
information. This project can help the various banks to perform all the transactions
provided by the application.
Engineering is not only a theoretical study but it is a implementation of all we
study for creating something new and making things more easy and useful through
practical study.
For me, it is very knowledgeable and interesting as well. I have chosen Java SE as
front end because it provides very good graphical user interface and Microsoft
Office Access as back end tool.
www.hclinfosystems.in
HCL Infosystems Ltd is Indias premier hardware, services and ICT systems
Integration Company offering a wide spectrum of ICT products that includes
Computing, Storage, Networking, Security, Telecom, Imaging and Retail. HCL is a
one-stop-shop for all the ICT requirements of an organization. India's leading
System Integration and Infrastructure Management Services Organization, HCL
has specialized expertise across verticals including Telecom, BFSI, eGovernance &
Power. HCL has India's largest distribution and retail network, taking to market a
range of Digital Lifestyle products in partnership with leading global ICT brands,
including Apple, Cisco, Ericsson, Kingston, Kodak, Konica Minolta, Microsoft,
Nokia, Toshiba, and many more.
HCL Infosystems (HCLI) draws its strength from 30 years of experience in
handling the ever changing IT scenario , strong customer relationships, ability to
provide the cutting edge technology at best-value-for-money and on top of it, an
excellent service & support infrastructure. Today, HCL is country's premier
information enabling company. It offers one-stop-shop convenience to its diverse
customers having an equally diverse set of requirements.
Technology Leadership:
HCL Infosystems is known to be the harbinger of technology in the country. Right
from its inception it has attempted to pioneer the technology introductions in the
country either through its R&D or through partnerships with the world technology
leaders.
Using its own R&D it has:
Created its own UNIX & RDBMS capability (in 80s).
Developed firewalls for enterprise & personal system security.
Launched its range of enterprise storage products.
Launched its range of networking products.
HCL strive to understand the technology from the view of supporting it post
installation as well. This is one of the key ingredients that go into its strategic
advantage.
Contents
1.
INTRODUCTION
2.
METHODOLOGY
3.
4.
5.
6.
7.
8.
9.
SOURCE CODE
10.
LIMITATIONS
11.
FUTURE ASPECTS
12.
CONCLUSION
INTRODUCTION
Banker database system:
Banker database system is an application which uses a database to perform bank
transactions. We used Java as front end and Microsoft Office Access as back end.
This project has a main class that brings up a class and a file menu that display
about banker. Main class inherits and calls all other classes through the pressing of
corresponding buttons and adds records to the program. The main class enables
withdrawing or depositing to an account and displays the account information.
Here, we also have an account master class through which new accounts can be
added to the database along with their initial balance.
The objective of the project is to develop a GUI based automated system, which
will cover all the information related to the Account holder. For example: creating
new account, deposit or withdrawal, balance information.
Features:
Banker database system enables creating new accounts along with their
initial balance, withdrawing or depositing to an account and also displaying the
account information. The entire database is stored in Microsoft Office Access
which is familiar to everyone and anyone can access it easily. So, the banker
database system is user friendly.
METHODOLOGY
The methodology used in banker database system includes four steps:
1. Planning and aims
2. Implementation
3. Evaluation
4. Feedback and improvement procedures
RAM: 128MB
Hard disk: 5GB
We have used Java SE as front end tool & Microsoft Office Access as back end tool
described as follows:
Java SE:
Java Platform, Standard Edition or Java SE is a widely used platform
for programming in the Java language. It is the Java Platform used to deploy
portable applications for general use. In practical terms, Java SE consists of a
virtual machine, which must be used to run Java programs, together with a
set of libraries (or "packages") needed to allow the use of file systems,
networks, graphical interfaces, and so on, from within those programs.
Advantages of Java SE:
Software developers and data architects can use Microsoft Access to develop
application software, and "power users" can use it to build simple applications.
Like other Office applications, Access is supported by Visual Basic for
Applications, an object-oriented programming language that can reference a
variety of objects including DAO (Data Access Objects), ActiveX Data Objects,
and many other ActiveX components. Visual objects used in forms and reports
expose their methods and properties in the VBA programming environment, and
VBA code modules may declare and call Windows operating-system functions.
DATABASE
INFORMATION
SHOW
2. Main Menu
3. Accounts Master
5. Deposits/Withdrawals
6. Display Balance
1. Master
2. Transaction
SOURCE CODE
/**Banker.java*/
package bank;
/**
* <p>Title: Banker</p>
* <p>Description: Application which uses a database to perform
bank transactions</p>
* <p>College: Baldevram Mirdha Institute of Technology,
Jaipur</p>
* @Ritesh Kumar, Priyanka
* @2008-2012
*/
import java.awt.*;
import java.sql.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
import bank.MainMenu;
public class Banker extends JFrame{
private JMenu fileMenu; // Declare Menu fileMenu
private JTextArea outputTextArea;
public Banker() {
super ("Banker");
try {
/////// File Menu ///////
fileMenu = new JMenu("File");
fileMenu.setMnemonic('F');
JMenuItem aboutItem = new JMenuItem("About Banker...");
aboutItem.setMnemonic('A');
String output;
outputTextArea = new JTextArea(); // Instantiate
outputTextArea
// Declare string output for aboutbox and add it to
outputTextArea
output = new String("Programmer: \n\tRitesh Kumar
&\n\tPriyanka\n\tBatch: 2008-2012\n\tB.M.I.T. Jaipur");
outputTextArea.setText(output);
outputTextArea.setEditable(false);
outputTextArea.setBackground(Color.lightGray);
outputTextArea.setFont(new Font("Ariel",Font.PLAIN,12));
////////// Show About Box on aboutItem pressed ///////////
aboutItem.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
JOptionPane.showMessageDialog(Banker.this,outputTextArea,
"About Banker",JOptionPane.PLAIN_MESSAGE);
}
}
);
////////////////////////////////
fileMenu.add(aboutItem); //// Add aboutItem to fileMenu
JMenuItem exitItem = new JMenuItem("Exit");
exitItem.setMnemonic('X');
///////// Exit on exitItem Pressed ///////////
exitItem.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
System.exit(0);
}
}
);
fileMenu.add(exitItem); /// Add exitItem to fileMenu
JMenuBar bar = new JMenuBar();
setJMenuBar(bar);
bar.add(fileMenu);
setSize(400,400);
setVisible(true);
setLocation(500,200);
MainMenu bank1 = new MainMenu(); // Call MainMenu
bank1.setResizable(false); // set MainMenu resizable to
false
}
catch(Exception e) {
e.printStackTrace();
}
}
/////////// Main method ///////////////
public static void main(String args[])
{
///// Set lookandfeel to windowslookandfeel //////
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName(
));
}
catch(Exception e) {
/**AccMaster.java*/
package bank;
import
import
import
import
java.awt.*;
java.sql.*;
java.awt.event.*;
javax.swing.*;
panel1.add(accNoTxt);
opnBalLbl = new JLabel("Enter Opening Balance.");
panel1.add(opnBalLbl);
opnBalTxt = new JTextField(15);
panel1.add(opnBalTxt);
btn = new JButton("Ok");
panel1.add(btn);
/////////////////////////////////
//////// Add handlers to opnBalTxt ////////
EventHandler handler = new EventHandler();
opnBalTxt.addActionListener(handler);
///////////////////////////////////////////
btn.addActionListener(handler);
// Add panel1 to container
container.add(panel1,BorderLayout.CENTER);
setSize(250,200);
setVisible(true);
setLocation(575,320);
}
// Inner class for EventHandler
private class EventHandler implements ActionListener{
// Handles textbox event
public void actionPerformed(ActionEvent event)
{
// If Enter is pressed when opnBalTxt box has focus
if (event.getSource() == btn &&
opnBalTxt.getText() != null && opnBalTxt.getText() != " ")
{
/// Confirm addition of information to database
int choice = JOptionPane.showConfirmDialog(frame,
"Add this information to the database?",
"Banker",JOptionPane.YES_NO_OPTION);
// If YES
if(choice == JOptionPane.YES_OPTION)
{
try {
// load database driver class
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
// connect to database
Connection connection =
DriverManager.getConnection("jdbc:odbc:Bank");
// create Statement to query database
Statement statement = connection.createStatement();
// Add new acount to Master table
Statement stmt = connection.createStatement();
stmt.executeUpdate(
"INSERT INTO Master " +
"VALUES ('" + accNoTxt.getText() + "', " +
Long.parseLong(opnBalTxt.getText())+ ")");
JOptionPane.showMessageDialog(null,"Data Entered into
Database Successfully");
opnBalTxt.setText(" ");
accNoTxt.setText(" ");
statement.close(); // Close statement
connection.close(); // Close connection
setVisible(false); // Hide frame
}
// end try
}
// If NO
else{
opnBalTxt.setText(" ");
accNoTxt.setText(" ");
/**depositDraw.java*/
package bank;
import
import
import
import
java.awt.*;
java.sql.*;
java.awt.event.*;
javax.swing.*;
= '" +
System.exit( 1 );
}
}
else{
JOptionPane.showMessageDialog(null,"You Cannot
Draw more than you have.");
accNoTxt.setText(" ");
transAmountTxt.setText(" ");
setVisible(false);
}
}
else{
JOptionPane.showMessageDialog(null,"You cannot
withdraw more than $15,000.");
accNoTxt.setText(" ");
transAmountTxt.setText(" ");
setVisible(false);
}
}
else
if (transactionType == 1){ // Deposit
try {
// load database driver class
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
// connect to database
Connection connection2 =
DriverManager.getConnection("jdbc:odbc:Bank" );
Statement stmt2 = connection2.createStatement();
stmt2.executeUpdate(
"INSERT INTO Transaction " +
"VALUES ('" + accNoTxt.getText() + "', " +
String.valueOf(transAmountTxt.getText())+ ","+
transactionType + ")");
//String current_balance1 = results.toString();
// long current_balance =
String.valueOf(current_balance1);
double answer = current_balance + transaction_amount;
String updateString = "UPDATE Master " +
"SET Current_Balance = "+ answer + " " +
"WHERE Account_No LIKE '" + accNoTxt.getText() + "'";
stmt2.executeUpdate(updateString);
JOptionPane.showMessageDialog(null,"Data Entered into
Database Successfully");
accNoTxt.setText(" ");
transAmountTxt.setText(" ");
stmt2.close();
connection2.close();
setVisible(false);
}
catch ( SQLException sqlException ) {
JOptionPane.showMessageDialog( null,
sqlException.getMessage(), "Database Error",
JOptionPane.ERROR_MESSAGE );
System.exit( 1 );
}
catch ( ClassNotFoundException classNotFound ) {
JOptionPane.showMessageDialog( null,
classNotFound.getMessage(), "Driver Not Found",
JOptionPane.ERROR_MESSAGE );
System.exit( 1 );
}
}
}
// end try
// detect problems interacting with the database
catch ( SQLException sqlException ) {
JOptionPane.showMessageDialog( null,
sqlException.getMessage(), "Database Error",
JOptionPane.ERROR_MESSAGE );
System.exit( 1 );
}
catch ( ClassNotFoundException classNotFound ) {
JOptionPane.showMessageDialog( null,
classNotFound.getMessage(), "Driver Not Found",
JOptionPane.ERROR_MESSAGE );
System.exit( 1 );
}
}
else{
accNoTxt.setText(" ");
transAmountTxt.setText(" ");
setVisible(false);
}
}
} }
}
/**DispBal.java*/
package bank;
import
import
import
import
java.awt.*;
java.sql.*;
java.awt.event.*;
javax.swing.*;
panel1.add(balanceTxt);
btn = new JButton("Ok");
/////////////////////////////////
//////// Add handlers to opnBalTxt ////////
EventHandler handler = new EventHandler();
accNoTxt.addActionListener(handler);
balanceTxt.addActionListener(handler);
btn.addActionListener(handler);
panel1.add(btn);
///////////////////////////////////////////
// Add panel1 to container
container.add(panel1,BorderLayout.CENTER);
setSize(220,200);
setVisible(true);
setLocation(590,320);
}
private class EventHandler implements ActionListener{
public void actionPerformed(ActionEvent event)
{
if (event.getSource() == btn)
////////////////////////////////////////////////////////
///////////////////
if (accNoTxt.getText() != null && accNoTxt.getText() !
= " "){
try {
// load database driver class
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
// connect to database
Connection connection =
DriverManager.getConnection("jdbc:odbc:Bank");
// create Statement to query database
Statement statement = connection.createStatement();
// query database
ResultSet resultSet =
statement.executeQuery(
"SELECT Current_Balance FROM Master WHERE Account_No
= '" + accNoTxt.getText() + "'");
// process query results
StringBuffer results = new StringBuffer();
ResultSetMetaData metaData = resultSet.getMetaData();
int numberOfColumns = metaData.getColumnCount();
while ( resultSet.next() ) {
for ( int i = 1; i <= numberOfColumns; i++ ) {
results.append( resultSet.getObject( i ));
}
}
statement.close();
connection.close();
balanceTxt.setText(results.toString());
// end try
/**MainMenu.java*/
package bank;
import
import
import
import
java.awt.*;
java.awt.event.*;
javax.swing.*;
bank.*;
public MainMenu() {
super("Main Menu");
// Get contentPane and set its layout
Container container = getContentPane();
container.setLayout(new FlowLayout());
panel1 = new JPanel();
mainLbl = new JLabel("
Main Menu");
panel1.add(mainLbl);// add mainLbl to panel1
accMasterBtn = new JButton("Accounts Master");
panel1.add(accMasterBtn);// add accMasterBtn to panel1
depositsBtn = new JButton("Deposits");
panel1.add(depositsBtn);// add depositsBtn to panel1
withDrawalsBtn = new JButton("Withdrawals");
panel1.add(withDrawalsBtn);// add withDrawalsBtn to panel1
dispBalBtn = new JButton("Display Balance");
panel1.add(dispBalBtn); // add disoBalBtn to panel1
panel1.setLayout(new GridLayout(5,1,10,10));
container.add(panel1,BorderLayout.CENTER); // Add panel1 to
container
////// AddActionListner to components ///////
ButtonHandler handler = new ButtonHandler();
accMasterBtn.addActionListener(handler);
depositsBtn.addActionListener(handler);
withDrawalsBtn.addActionListener(handler);
dispBalBtn.addActionListener(handler);
setSize(300,230);
setVisible(true);
setLocation(550,280);
}
private class ButtonHandler implements ActionListener{
public void actionPerformed(ActionEvent event)
{
if(event.getSource() == accMasterBtn)
{ AccMaster acc = new AccMaster(); /// Call AccMaster Frame
acc.setResizable(false);
}
else if(event.getSource() == depositsBtn)
{ depositDraw dep = new depositDraw(1); /// Call AccMaster
Frame
dep.setResizable(false);
}
else if(event.getSource() == withDrawalsBtn)
{ depositDraw dep = new depositDraw(2); /// Call AccMaster
Frame
dep.setResizable(false);
}
else if(event.getSource() == dispBalBtn)
{ DispBal bal = new DispBal(); /// Call AccMaster Frame
bal.setResizable(false);
}
}}}
LIMITATIONS
Although I have tried to do the best & tried to do all the things that are possible in
the system, but still the system contains some of the limitations because of time
constraints.
I am still working on this application and my next goal is to remove these
limitations and develop a more efficient and elegant system.
FUTURE ASPECTS
Banker database system doesnt end here; it is just a starting, we will look forward
for its future development through more and more challenging projects and also
foraying into related areas in with innovative ideas.
CONCLUSION
Banker database system provides a graphical user interface to the end user so that
he/she can easily interact with the system and perform all the transactions provided
by the system with comfort and its our main goal to provide ease to the end user,
customers comfort is the main priority of this system.