Академический Документы
Профессиональный Документы
Культура Документы
DISSERTATION
of
Bachelor of Technology
in
Information Technology
By:
Dwarka,New Delhi
Year 2015-2019
Table of Contents
Introduction …………………………………………….1
Project Description………………………………….......2
Problems with Existing System…………………….......4
Proposed System………………………………………..4
Software Architecture of Proposed System …………..5
Feasibility Study……………………………………......5
Front End……………………………………………….6
Back End………………………………………………10
Reason for choosing JAVA…………………………...12
Hardware Requirement………………………………..12
Software Requirement………………………………...12
Coding of the Project………………………………….13
Outputs………………………………………………...53
Conclusion…………………………………………….57
References……………………………………………..58
1. Blood Bank Centre
Project Name
Objectives
The Main objective of the project is to provide convenience to users an information regarding
the Availability of blood units in the various blood banks of the district.
The project’s objective is to access the server for making reliable connections in response
to request for connection by client and delivering Information.
It aims at daily update of data to deliver information to client without any flaws and with
high reliability
It aims at creating a user friendly environment for login or signup. It ensures the security of
user’s account as no user with wrong password or no user with same username can access the
account.
Citizens will be able to access the blood availability and the location of blood banks
according to their residing districts from their homes
Citizens will be able to access data according the nearest hospital and also according to
emergency requirements of specific blood groups and blood component count
Citizens will be able to fill blood donation forms online which will allow specialized
Ambulance vans to collect blood right from the doorstep
The blood Bank centers can login to update the availability of the various blood group and
components on a daily basis
A district officer can monitor the activation and deactivation of blood banks and specific
blood group requirements
Support has been added to expand the system to other states in future.
Description
As an Admin, the blood Bank officials can access and Update the Records of blood availability on a
regular Basis.
A District official for each District can Monitor the records of all the Hospitals and also Activate and
deactivate the availability of a specific component. The official can verify the blood report of a Blood
Donor and can add temporary ones to be added to a genuine Donor list.
Sometimes even in Complete Surplus availability, the lack of location of storage and other information
leads to chaos and maybe untimely delivery of blood to a patient .The System allows a User to search
with ease a blood group with convenience of home in case of emergencies and timely delivery of blood
can help save a precious life.
2 .Drawbacks in existing system
Although Blood Bank Centres have come a long way with several landmark improvement in
technology and health services but it has some drawbacks:-
Long Queues
No prompt service in case of Emergency
Many Patients die every year due to lack of timely reach of service
Long Waiting Time
Lack of knowledge of procedure
Although deposits are much, there is no information upon which blood bank has the
availability during requirement
3 .Proposed System
Citizens will be able to access the blood availability and the location of blood banks
according to their residing districts from their homes
Citizens will be able to access data according the nearest hospital and also according to
emergency requirements of specific blood groups and blood component count
Citizens will be able to fill blood donation forms online which will allow specialized
Ambulance vans to collect blood right from the doorstep
The blood Bank centers can login to update the availability of the various blood group and
components on a daily basis
A district officer can monitor the activation and deactivation of blood banks and specific
blood group requirements
Support has been added to expand the system to other states in future
Economic Feasibility
The project would require the cost of a central application server along with computers and operators
for the blood banks of various districts.
Schedule Feasibility
Gantt chart Follows in Last section. The project has been Alloted a Time period of 7 months
including Testing and Installation.
6 .Front End
Java is a general purpose and the most popular object-oriented programming language. Java was
developed by James Gosling and his colleagues at Sun Microsystems in the early 1990’s.
Due to its simplicity and easy to learn and advanced features, we opted this language for our six months
industrial training. This language supports many interesting features that make it an ideal language for
software development. In addition to the object oriented features, it also provides features such as
platform independence, security, multithreading, portability; etc which makes it well suited for the
web and networked services, applications, platform-independent desktops, robotics and any other
embedded devices.
Simple: Java is a compact and simple language. Programs are easy to write and debug as it omits
many clumsy, poorly understood and confusing features of other programming languages such as
C++.
Distributed: Java is a distributed language which means that the programs can be designed to run
on computer networks. Java provides an extensive library of classes for communicating using
TCP/IP protocols such as HTTP and FTP. This makes creating network connections much easier.
Robust: Java is designed for writing programs that are highly robust and Reliable
Architectural Neutral: This means that the programs written on one platform can run on any
other platform without having to rewrite or recompile them. It follows ‘Write-once-run-
anywhere’ approach.
Portable: In Java, the size of the primitive data types is machine independent. These
consistencies make java program portable among different platforms such as Windows, UNIX
and Mac.
Interpreted: Java is such a language that is both compiled and interpreted. The two steps of
compilation and interpretation allow extensive code checking and improved security.
High performance: Java programs are complied with portable intermediate form known as byte
codes, rather than to native machine level instructions and JVM executes java byte codes on
any machine on which it is installed. This architecture means that java programs are faster.
Dynamic: Java is designed to be dynamic. Classes are stored in separate files and are loaded
into the Java Interpreter only when they are needed
Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC) —
an API for providing a graphical user interface (GUI) for Java programs.
Swing was developed to provide a more sophisticated set of GUI components than the
earlier Abstract Window Toolkit (AWT). Swing provides a native look and feel that emulates the
look and feel of several platforms, and also supports a pluggable look and feel that allows
applications to have a look and feel unrelated to the underlying platform. It has more powerful and
flexible components than AWT.
In addition to familiar components such as buttons, check boxes and labels, Swing provides several
advanced components such as tabbed panel, scroll panes, trees, tables, and lists.
Unlike AWT components, Swing components are not implemented by platform-specific code.
Instead, they are written entirely in Java and therefore are platform-independent. The term
"lightweight" is used to describe such an element.[1]
Swing is currently in the process of being replaced by JavaFX.
Swing Components in Java
Jbutton: This is used to create a Button using a text, icon, string or both. When a button is pressed an
ActionEvent is generated
JtextField: This is used to take an input of a single line using methods of “gettext( )” & “settext( )”
JLabel: This can display either text, an image, or both. Label's contents are aligned by setting the
vertical and horizontal alignment in its display area. By default, labels are vertically centered in
their display area. Text-only labels are leading edge aligned, by default; image-only labels are
horizontally centered, by default.
JFrame : Java Swing Tutorial Explaining the JFrame class. The components added to the frame are
referred to as its contents; these are managed by the contentPane. To add a component to a JFrame,
we must use its content Pane instead .JFrame is a Window with border, title and buttons. When JFrame
is set visible, an event dispatching thread is started. JFrame objects store several objects including
a Container object known as the content pane. To add a component to a JFrame, add it to the content
pane.
7 .Back End
Larry Ellison and two friends and former co-workers, Bob Miner and Ed Oates, started a consultancy
called Software Development Laboratories (SDL) in 1977. SDL developed the original version of the
Oracle software. The name Oracle comes from the code-name of a CIA-funded project Ellison had
worked on while previously employed by Ampex.
As computers running Oracle often have many multi-core processors (resulting in many cores, all to
be licensed), the software price can rise into the hundreds of thousands of dollars. The total cost of
ownership often exceeds this, as large Oracle installations usually require experienced and
trained database administrators to do the set-up properly. Furthermore, further components must be
licensed and paid for, for instance the Enterprise Options used with the databases. Many licensing
pitfalls let even rise the costs of ownership. Because of the product's large installed base and available
training courses, Oracle specialists in some areas have become a more abundant resource than those
for more exotic databases. Oracle frequently provides special training offers for database-
administrators.
On Linux, Oracle's certified configurations include Oracle's own Oracle Linux and other
commercial Linux distributions (Red Hat Enterprise Linux 3, 4 and 5, SuSE SLES 8, 9, 10 and
11, Asianux), which can cost in a range from a few hundred to a few thousand USD per year
(depending on processor architecture and the support package purchased).
The Oracle database system can also install and run on freely available Linux distributions such as the
Red Hat-based CentOS or Debian-based systems.
Windows vs. Multi-Platform: Microsoft .NET is primarily targeted for the windows
operating system. Java, on the other hand, is based on the idea that the same software should
run on many different kinds of computers, consumer gadgets, and other devices on a
network.
Complexity: Microsoft tools have an edge over Java for building applications that require
rich graphical user interfaces and that deliver content to web browsers. The perception is that
Java servers are better for complex applications supporting higher volumes of users.
Proprietary vs. Open source: One of Java’s strengths is that a wide variety of tools, products,
and applications are available from numerous vendors.
Competition among Java EE vendors drives innovation, while strict compatibility standards
help maintain quality. Microsoft users, on the other hand, must rely on Microsoft for all
.NET innovation.
9 .Hardware Requirements
Hardware requirements include that hardware which is required for its working. It includes:
Pentium 4 Computer
512 MB RAM
High Speed Internet Connection(DSL/Cable)
10 .Software Requirements
The technical specifications of requirements for the software are as follows:
Any Operating System (Windows, Linux, MAC)
package design;
import Logic.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.ResultSet;
//import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
*/
/**
*/
public static String diodistt=null,bankuserpwd=null,bankusername=null;
public Login() {
initComponents();
//setResizable(false);
Toolkit tk=Toolkit.getDefaultToolkit();
Dimension d=tk.getScreenSize();
setSize(d);
jLabel1.setOpaque(true);
// getContentPane().setBackground(Color.blue);
@SuppressWarnings("unchecked")
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setToolTipText("");
jLabel2.setText("User:");
jLabel2.setToolTipText("");
jLabel3.setText("Password:");
jLabel3.setToolTipText("");
jTextField1.setToolTipText("");
jPasswordField1.setToolTipText("");
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/addEmp1.png"))); //
NOI18N
jButton1.setText("LogIn");
jButton1.addActionListener(new java.awt.event.ActionListener() {
jButton1ActionPerformed(evt);
});
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
.addComponent(jTextField1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1)))
.addContainerGap(79, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jButton2.setText("NEXT");
jButton2.addActionListener(new java.awt.event.ActionListener() {
jButton2ActionPerformed(evt);
});
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addContainerGap(87, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(38, 38, 38)
.addComponent(jButton2)
.addContainerGap(23, Short.MAX_VALUE))
);
jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/bloodLogo1.png")));
// NOI18N
jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/loginHeader.png")));
// NOI18N
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel5)))
.addComponent(jLabel4)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(52, Short.MAX_VALUE))
);
jPanel1.getAccessibleContext().setAccessibleDescription("");
pack();
}// </editor-fold>
//
String user=jTextField1.getText();
String pwd=jPasswordField1.getText();
try
{
if(rs.next())
System.out.println("reruio");
bankusername=rs.getString(2);
b_bank_code=rs.getString(5);
userid=rs.getString(1);
distt_id=rs.getString(4);
bankuserpwd=pwd;
JOptionPane.showMessageDialog(rootPane,"Welcome Admin!!!");
dispose();
Admin_Welocme.main(new String[]{"ram"});
else if(rs1.next())
System.out.println("6544657687");
dioid=rs1.getInt(1);
System.out.println(dioid);
diodistt=rs1.getString(2);
diodisttcode=rs1.getInt(3);
System.out.println(diodisttcode);
dispose();
DIO_welcome.main(new String[]{"ram"});
System.out.println("$%^*(");}
else
System.out.println("678cgkjh");
catch(Exception e){System.out.println("cdfdc");}
//"AmbalaCity", "Bhiwani","Faridabad","Fatehabad","Gurgaon","Hisar","Jhajjar
"JInd","Kaithal","Karnal""Kurukshetra","Mahendragarh" "Mewat","Palwal""panchkula", "panipat"
,"Rewari" "Rohtak", "sirsa", "Sonipat", "Yamuna nagar"
String distt=String.valueOf(disttlist.getSelectedItem());
if(distt.equals("Ambala"))
distt_code=4;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
}
else if(distt.equals("Bhiwani"))
distt_code=5;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Faridabad"))
distt_code=1;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Fatehabad"))
distt_code=6;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
}
else if(distt.equals("Gurgaon"))
distt_code=3;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Hisar"))
distt_code=7;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Jhajjar"))
distt_code=8;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
}
else if(distt.equals("Jind"))
distt_code=9;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Kaithal"))
distt_code=10;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Karnal"))
distt_code=11;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
}
else if(distt.equals("Kurukshetra"))
distt_code=12;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Mahendragarh"))
distt_code=13;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Mewat"))
distt_code=14;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
}
else if(distt.equals("Palwal"))
distt_code=2;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Panchkula"))
distt_code=15;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Panipat"))
distt_code=16;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
}
else if(distt.equals("Rewari"))
distt_code=17;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Rohtak"))
distt_code=18;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else if(distt.equals("Sirsa"))
distt_code=19;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
}
else if(distt.equals("Sonipat"))
distt_code=20;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
distt_code=21;
distt_select=distt;
dispose();
//String s[]={"ram"};
CitizenWelcome.main(new String[]{"Ram"});
else
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
*/
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
new Login().setVisible(true);
});
}
catch(Exception e){}
return rs;
}
}
catch(Exception e)
{
}
return rs;
}
public static ResultSet check_login(String user,String pwd)//login for blood bank user
{
ResultSet rs=null;
try
{
Connection con=Connect.conn();
Statement st=con.createStatement();
//USER_ID USER_NAME PWD STATE_CODE DISTT_CODE
ADMIN_ID B_BANK_CODE CHECKLOGIN DEACT
rs=st.executeQuery("select user_id,user_name,pwd,distt_code,b_bank_code from
user_master where user_name='"+user+"' and pwd='"+pwd+"' ");
//check=rs.next();
}
catch(Exception e){}
return rs;
}
public static int no_of_hospital(int distt_code)
{
int val=0;
ResultSet rs=null;
try
{
Connection con=Connect.conn();
Statement st=con.createStatement();
rs=st.executeQuery("select count(B_BANK_NAME) from b_bank_master where
distt_code="+distt_code+"");
rs.next();
val=rs.getInt(1);
}
catch(Exception e)
{
System.out.println("exception in no_of_hospital :"+e);
}
return val;
}
public static ResultSet acess_hospital_name(int distt_code)
{
ResultSet rs=null;
try
{
//B_BANK_PHONE,B_BANK_CONT_PER,B_BANK_EMAIL,B_BANK_ADDRESS
from B_bank_master
Connection con=Connect.conn();
Statement st=con.createStatement();
rs=st.executeQuery("select B_BANK_NAME from b_bank_master where
distt_code="+distt_code+" and deact=0");
}
catch(Exception e)
{
System.out.println("exception in access_hospital_name :"+e);
}
return rs;
}
}
catch(Exception r){}
return rs;
}
rs=st.executeQuery("select
B_GROUP,WHITE_BLOOD_CELLS,RED_BLOOD_CELLS,FRESH_FROZEN_PLASM
A,PLATLETS from newbloodinfo where b_bank_code='"+b_bank_code+"' and deact=0");
}
catch(Exception e)
{
}
return rs;
}
}
return rs;
}
}
return dcode;
}
public static int saveDonorDatatemp(String don_distt_name,String don_name,String
don_address,String don_phone,String don_email,String don_bloodgroup,String
don_age,String don_bloodsum)
{
int r=0;
try
{
String don_distt_code=getdisttcode(don_distt_name);
// DON_DISTT_CODE DON_ID DON_NAME DON_ADDRESS
DON_PHONE DON_EMAIL DON_BLOODGROUP DON_AGE
DON_BLDSUM
Connection con=Connect.conn();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select max(don_id)from temp_donate");
rs.next();
int don_id=Integer.parseInt(rs.getString(1))+1;
System.out.println("test1");
st=con.createStatement();
System.out.println(don_distt_code);
System.out.println(don_id);
System.out.println(don_name);
System.out.println(don_address);
System.out.println(don_phone);
System.out.println(don_email);
System.out.println(don_bloodgroup);
System.out.println(don_age);
System.out.println(don_bloodsum);
r=st.executeUpdate("insert into temp_donate
values('"+don_distt_code+"','"+don_id+"','"+don_name+"','"+don_address+"','"+don_phone+
"','"+don_email+"','"+don_bloodgroup+"','"+don_age+"','"+don_bloodsum+"','0')");
System.out.println("test2");
}
catch(Exception e){System.out.println(e);}
return r;
}
}
catch(Exception e){}
return add;
}
}
catch(Exception e){}
return status;
}
//update password
public static int updatePassword(String old,String newpwd,String confirmnewpwd,String
b_bank_code)
{
int r=0;
try
{
if(old.equals(Login.bankuserpwd))
{
if(newpwd.equals(confirmnewpwd))
{
Connection con=Connect.conn();
Statement st=con.createStatement();
r= st.executeUpdate("update user_master set pwd='"+newpwd+"' where
b_bank_code='"+b_bank_code+"'");
return r;
}
else
return -1;
}
else
return -2;
}
catch(Exception e){}
return r;
}
import design.Login;
import java.sql.Connection;
import jpava.sql.ResultSet;
import java.sql.Statement;
/**
*
* @author Praveen Chauhan
*/
public class LogicDIO {
public static String getInfo()
{
int b_bank_code=0;
try
{
Connection con=Connect.conn();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select max(b_bank_code)from b_bank_master");
rs.next();
b_bank_code=Integer.parseInt(rs.getString(1))+1;
}catch(Exception e){}
return String.valueOf(b_bank_code);
}
public static int save_in_newbloodinfo(String b_bank_code,String distt_code,String
dioid,String b_bank_name,String b_bank_phone,String cper,String email,String add)
{
String bloodgroup[]={"A(+)","A(-)","B(+)","B(-)","O(+)","O(-)","AB(+)","AB(-)"};
int i;
int res=0;
try
{
Connection con=Connect.conn();
Statement st=con.createStatement();
//B_BANK_CODE B_BANK_NAME B_BANK_PHONE B_BANK_CONT_PER
B_BANK_EMAIL B_BANK_ADDRESS STATE_CODE
DISTT_CODE ADMIN_ID DEACT
st.executeUpdate("insert into b_bank_master
values('"+b_bank_code+"','"+b_bank_name+"','"+b_bank_phone+"','"+cper+"','"+email+"','"
+add+"','1','"+distt_code+"','"+dioid+"','0')");
//B_BANK_CODE B_GROUP WHITE_BLOOD_CELLS RED_BLOOD_CELLS
FRESH_FROZEN_PLASMA PLATLETS DISTT_CODE
for(i=0;i<bloodgroup.length;i++)
{
res=st.executeUpdate("insert into
newbloodinfo(b_bank_code,b_group,distt_code)values('"+b_bank_code+"','"+bloodgroup[i]
+"','"+distt_code+"')");
}
}catch(Exception e){}
return res;
}
public static void insert_bank_userpwd(String USER_ID,String USER_NAME,String
PWD,String STATE_CODE,String DISTT_CODE,String ADMIN_ID,String
B_BANK_CODE,String CHECKLOGIN,String DEACT)
{
try
{
Connection con=Connect.conn();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select max(user_id)from user_master");
rs.next();
int id=Integer.parseInt(rs.getString(1))+1;
st.executeUpdate("insert into user_master
values('"+String.valueOf(id)+"','"+USER_NAME+"','"+PWD+"','"+STATE_CODE+"','"+DI
STT_CODE+"','"+ADMIN_ID+"','"+B_BANK_CODE+"','"+CHECKLOGIN+"','0')");
}
catch(Exception e){}
}
while(rs.next())
{
System.out.println("test");
for(j=0;j<8;j++)
data[i][j]=rs.getString(j+1);
i++;
System.out.println("3");
}
System.out.println(data[0][0]);
}
for(j=0;j<7;j++)
System.out.print(data[i][j]+"\t");
System.out.println();
}
}
14. References
w3schools.org
Oracle.com
J2se.com