Académique Documents
Professionnel Documents
Culture Documents
The basic need for the package was to automate the whole procedure of
maintaining of student details, earlier it was all done manually. By developing this
package lot of burden was removed from the department, which was maintaining
students details. It improved the efficiency, reduced the cost, and reduced the time
need to do the work manually. With the help of this package the past details of the
students can assessed and reports can be generated on this details.
In brief we can say this system was required to automate the processing of
students details, which was done manually before the development of the package.
Earlier all the information / data pertaining to the students was maintained
manually or we can say it was on paper, hence it created a problem for the
organization/ school, how to manage it properly. With the help of this system the
organization/school is able to maintain the data properly & accurately.
Solution?
The solution for all this problem was to automate the system, automation of
the students data maintenance would reduce the manpower, man days will result in
accurate data & above all increase the efficiency of the concerned department.
offline
Main the accuracy, integrity and consistency of the data
Providing such a mechanism to make the man power fast to maintain all the
students.
Employee Module : Used for managing the employee details
Attendance Module : Used for Managing the attendance of the students
Login Module: Used for managing the login details
Salary Module : Used for managing the salary of the employee
Reports
Reports
Reports
Reports
Reports
Reports
for
for
for
for
for
for
all
all
all
all
all
all
Students
teachers
attendance
fees records
login users
salary details
The software quality plan we will use the following SQA Strategy:
In the first step, we will select the test factors and rank them. The selected
test factors such as reliability, maintainability, portability or etc, will be placed
The last step is that deciding the test phase of addressing the risks. In this step, we
will decide that which risks will be placed each development phase.
Name of component
Specification
Operating System
Language
Database
Browser
Web Server
Software Development Kit
Scripting Language Enable
Database JDBC Driver
Hardware Requirements:
Name of component
Processor
RAM
Hard disk
Monitor
Keyboard
Specification
Pentium III 630MHz
128 MB
20 GB
15 color monitor
122 keys
SYSTEM ANALYSIS
INTRODUCTION TO SYSTEM ANALYSIS
System analysis is a process of gathering and interpreting facts, diagnosing
problems and the information to recommend improvements on the system. It is a
problem solving activity that requires intensive communication between the system
users and system developers. System analysis or study is an important phase of
any system development process. The system is studied to the minutest detail and
analyzed. The system analyst plays the role of the interrogator and dwells deep into
the working of the present system. The system is viewed as a whole and the input
to the system are identified. The outputs from the organizations are traced to the
various processes. System analysis is concerned with becoming aware of the
problem,
identifying
the
relevant
and
decisional
variables,
analyzing
and
Existing System
In the existing system the exams are done only manually but in proposed system
we have to computerize the exams using this application.
Proposed System
The aim of proposed system is to develop a system of improved facilities. The
proposed system can overcome all the limitations of the existing system. The
system provides proper security and reduces the manual work.
Security of data.
Ensure data accuracys.
Proper control of the higher officials.
Minimize manual data entry.
Minimum time needed for the various processing.
Greater efficiency.
Better service.
User friendliness and interactive.
Minimum time required.
FEASIBILITY STUDY
Feasibility study is made to see if the project on completion will serve the purpose
of the organization for the amount of work, effort and the time that spend on it.
Feasibility study lets the developer foresee the future of the project and the
usefulness. A feasibility study of a system proposal is according to its workability,
which is the impact on the organization, ability to meet their user needs and
effective use of resources. Thus when a new application is proposed it normally
goes through a feasibility study .The document provide the feasibility of the project
that is being designed and lists various areas that were considered very carefully
during the feasibility study of this project such as Technical, Economic and
Operational feasibilities. The following are its features:
TECHNICAL FEASIBILITY
The system must be evaluated from the technical point of view first. The
assessment of this feasibility must be based on an outline design of the system
requirement in the terms of input, output, programs and procedures. Having
identified an outline system, the investigation must go on to suggest the type of
equipment, required method developing the system, of running the system once it
has been designed.
Technical issues raised during the investigation are:
The
should
be
developed
such
that
the
necessary
functions
and
performance are achieved within the constraints. The project is developed within
latest technology. Through the technology may become obsolete after some period
of time, due to the fact that never version of same software supports older
versions, the system may still be used. So there are minimal constraints involved
with this project. The system has been developed using Java the project is
technically feasible for development.
ECONOMIC FEASIBILITY
The developing system must be justified by cost and benefit. Criteria to ensure that
effort is concentrated on project, which will give best, return at the earliest. One of
the factors, which affect the development of a new system, is the cost it would
require.
The following are some of the important financial questions asked during
preliminary investigation:
Since the system is developed as part of project work, there is no manual cost to
spend for the proposed system. Also all the resources are already available, it give
an indication of the system is economically possible for development.
Sites also often aim to increase their web traffic through inclusion on
User module: This is a normal level of user who will be very few number of
HTML has been used for developing the User Layout for the system
JavaScript has been used for creating all the validations and client side
scripting functionality
CSS has been used for designing the web pages of the system
Processor
Ram
512 MB or more
Cache
1 MB
Hard Disk
10 GB recommended
The system runs of apache server so it is needed that server must have
apache server version 2.0 available
We have used JSP for server side scripting so the current version of JSP must
be available on the server
MySQL database has been used for storing the data of the website
HTML has been used for creating the layout of the web application
CSS has been used for creating the designing of the webpages
JavaScript scripting language has been implemented on the system for
performing all of the Client Side Server Validation.
Login Class: Used for performing all the operations of the login functionality.
Page Class: Class for managing all the operations of the page.
Traffic Class: Class for managing the traffic of the website
IP Class: It has been used for storing all the IPs which hits the website
Users Class: Class for managing all the user operations
Permission Class: This class has been used for managing all the permissions
level opeations.
Maintainability: It is very easy to maintain the system. The system has been
developed on JSP so anyone who has the knowledge of JSP, can easily
maintain the system
Portability: Yes this system is portable and we can switch the servers very
easily.
the
currently
popular
web
browser.
Beta Testing:
On the other hand, when a system isto be marked as a software product, another
process called beta testing is often conducted. During beta testing, a system is
delivered among a number of potential users who agree to use it. The customers
then report problems to the developers. This provides the product for real use and
detects errors which may not have been anticipated by the system developers.
Unit Testing:
Each module is considered independently. it focuses on each unit of software as
implemented in the source code. it is white box testing.
Integration Testing:
Integration testing aims at constructing the program structure while at the same
constructing tests to uncover errors associated with interfacing the modules.
modules are integrated by using the top down approach.
Validation Testing:
Validation testing was performed to ensure that all the functional and performance
requirements are met.
System Testing:
It is executing programs to check logical changes made in it with intention of
finding errors. a system is tested for online response, volume of transaction,
recovery from failure etc. System testing is done to ensure that the system satisfies
all the user requirements.
Installation Phase
In this phase the new Computerized system is installed, the conversion to new
procedures is fully implemented, and the potential of the new system is explored.
System Installation
The process of starting the actual use of a system and training user personnel in its
operation.
Review Phase
This phase evaluates the successes and failures during a systems development
project, and to measure the results of a new Computerized Transystem in terms of
benefits and savings projected at the start of the project.
Development Recap
A review of a project immediately after completion to find successes and potential
problems in future work.
Post-Implementation Review
A review, conducted after a new system has been in operation for some time, to
evaluate actual system performance against original expectations and projections
for cost-benefit improvements. Also identifies maintenance projects to enhance or
improve the system.
THE STEPS IN THE SOFTWARE TESTING
The steps involved during Unit testing are as follows:
a.
b.
Preparation of the possible test data with all the validation checks.
c.
d.
e.
f.
The unit testing done included the testing of the following items:
1.
2.
3.
4.
5.
6.
After completing the Unit testing of all the modules, the whole system is integrated
with all its dependencies in that module. While System Integration, We integrated
the modules one by one and tested the system at each step. This helped in
reduction of errors at the time of the system testing.
The steps involved during System testing are as follows:
Preparation of the possible test data with all the validation checks.
The System Testing done included the testing of the following items:
1.
2.
3.
Testing the dependent modules together with all the possible test data
scripts.
4.
5.
After the completion of system testing, the next following phase was the
Acceptance Testing. Clients at their end did this and accepted the system with
appreciation. Thus, we reached the final phase of the project delivery.
There are other six tests, which fall under special category. They are
described below:
Peak Load Test: It determines whether the system will handle the volume of
activities that occur when the system is at the peak of its processing demand.
For example, test the system by activating all terminals at the same time.
Storage
Testing: It
determines
the
capacity
of
the
system
to
store
Recovery Testing: This testing determines the ability of user to recover data
or re-start system after failure. For example, load backup copy of data and
resume processing without data or integrity loss.
Human Factors Testing: It determines how users will use the system when
processing data or preparing reports.
Project Category
Relational Database Management System (RDBMS) : This is an RDBMS based
project which is currently using MySQL for all the transaction statements. MySQL is
an opensource RDBMS System.
Brief Introduction about RDBSM :
A relational database management system (RDBMS) is a database management
system (DBMS) that is based on the relational model as invented by E. F. Codd, of
IBM's San Jose Research Laboratory. Many popular databases currently in use are
based on the relational database model.
RDBMSs have become a predominant choice for the storage of information in new
databases used for financial records, manufacturing and logistical information,
personnel data, and much more since the 1980s. Relational databases have often
replaced legacy hierarchical databases and network databases because they are
easier to understand and use. However, relational databases have been challenged
by object databases, which were introduced in an attempt to address the objectrelational impedance mismatch in relational database, and XML databases.
Implementation Methodology:
Model View Controller or MVC as it is popularly called, is a software design pattern for
developing web applications. A Model View Controller pattern is made up of the
following three parts:
Model - The lowest level of the pattern which is responsible for maintaining data.
View - This is responsible for displaying all or a portion of the data to the user.
Controller - Software Code that controls the interactions between the Model and
View.
MVC is popular as it isolates the application logic from the user interface layer and
supports separation of concerns. Here the Controller receives all requests for the
application and then works with the Model to prepare any data needed by the View. The
View then uses the data prepared by the Controller to generate a final presentable
response. The MVC abstraction can be graphically represented as follows.
MVC (Model View Controller Flow) Diagram
PROJECT
SCHEDULING
An
elementary
Gantt chart
or Timeline
development
plan is
given
below.
The
February
March
Requirement
Gathering
Analysis
Design
Coding
Testing
Implement
W
W4
Identification of Need
The old manual system was suffering from a series of drawbacks. Since whole of
the system was to be maintained with hands the process of keeping, maintaining
and retrieving the information was very tedious and lengthy. The records were
never used to be in a systematic order. there used to be lots of difficulties in
associating any particular transaction with a particular context. If any information
was to be found it was required to go through the different registers, documents
there would never exist anything like report generation. There would always be
unnecessary consumption of time while entering records and retrieving records.
One more problem was that it was very difficult to find errors while entering the
records. Once the records were entered it was very difficult to update these
records. In present, work done in the electricity board is performed manually which
is a great headache for the department .The reason behind it is that there is lot of
information to be maintained and have to be kept in mind while running the
business .For this reason we have provided features Present system is partially
automated (computerized), actually existing system is quite laborious as one has to
enter same information at three different places.
Following points should be well considered:
Documents and reports that must be provided by the new system: there can
also be few reports, which can help management in decision-making and cost
controlling, but since these reports do not get required attention, such kind of
reports and information were also identified and given required attention.
of information, which will be at the click of the mouse. So the proposed system
helps in saving the time in different operations and making information flow easy
giving valuable reports.
DATA DICTIONARY:
This is normally represented as the data about data. It is also termed as
metadata some times which gives the data about the data stored in the
database. It defines each data term encountered during the analysis and
design of a new system. Data elements can describe files or the processes.
Following are some major symbols used in the data dictionary
= equivalent to
+ and
[] either/ or
() Optional entry
3.
Coding of DB Connection
package com;
import java.sql.*;
import java.util.*;
import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;
try
{
pstmt = connection.prepareStatement(SQL,
Statement.RETURN_GENERATED_KEYS);
pstmt.setString(1,(String)
attendanceData.get("attendance_student_id"));
pstmt.setString(2,(String)
attendanceData.get("attendance_date"));
pstmt.setString(3,(String)
attendanceData.get("attendance_in_time"));
pstmt.setString(4,(String)
attendanceData.get("attendance_out_time"));
record = pstmt.executeUpdate();
ResultSet rs = pstmt.getGeneratedKeys();
if(rs.next())
{
int last_inserted_id = rs.getInt(1);
error = Integer.toString(last_inserted_id);
}
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
//////////////////Function for getting Attendance Details//////////
public HashMap getAttendanceDetails(int attendance_id)
{
HashMap results = new HashMap();
int count=0;
try
{
String SQL = "SELECT * FROM attendance WHERE attendance_id =
"+attendance_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
results.put("attendance_id",rs.getString("attendance_id"));
results.put("attendance_student_id",Integer.parseInt(rs.getString("attendance_stud
ent_id")));
results.put("attendance_date",Integer.parseInt(rs.getString("attendance_month")))
;
results.put("attendance_in_time",rs.getString("attendance_amount"));
results.put("attendance_out_time",Integer.parseInt(rs.getString("attendance_date"
)));
count++;
}
if(count==0)
{
results.put("attendance_id","");
results.put("attendance_student_id",0);
results.put("attendance_date","");
results.put("attendance_in_time","");
results.put("attendance_out_time","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return results;
}
int record=0;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String)
attendanceData.get("attendance_student_id"));
pstmt.setString(2,(String)
attendanceData.get("attendance_month"));
pstmt.setString(3,(String)
attendanceData.get("attendance_amount"));
pstmt.setString(4,(String)
attendanceData.get("attendance_date"));
pstmt.setString(5,(String)
attendanceData.get("attendance_id"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
{
String SQL = "SELECT * FROM attendance, student where
attendance_student_id = student_id";
int count=0;
ArrayList resultArray = new ArrayList();
try
{
if(!student_id.equals("0"))
{
SQL = "SELECT * FROM attendance, student WHERE
attendance_student_id = student_id AND attendance_student_id = "+student_id;
}
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
HashMap results = new HashMap();
results.put("attendance_id",rs.getString("attendance_id"));
results.put("attendance_student_id",rs.getString("attendance_student_id"));
results.put("attendance_date",rs.getString("attendance_date"));
results.put("attendance_in_time",rs.getString("attendance_in_time"));
results.put("attendance_out_time",rs.getString("attendance_out_time"));
results.put("student_name",rs.getString("student_first_name")+"
"+rs.getString("student_middle_name")+" "+rs.getString("student_last_name"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultArray;
}
}
import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) employeeData.get("employee_user"));
pstmt.setString(2,(String) employeeData.get("employee_password"));
pstmt.setString(3,(String) employeeData.get("employee_level"));
pstmt.setString(4,(String) employeeData.get("employee_sal"));
pstmt.setString(5,(String)
employeeData.get("employee_first_name"));
pstmt.setString(6,(String)
employeeData.get("employee_middle_name"));
pstmt.setString(7,(String)
employeeData.get("employee_last_name"));
pstmt.setString(8,(String) employeeData.get("employee_gender"));
pstmt.setString(9,(String) employeeData.get("employee_address"));
pstmt.setString(10,(String) employeeData.get("employee_village"));
pstmt.setString(11,(String) employeeData.get("employee_state"));
pstmt.setString(12,(String) employeeData.get("employee_country"));
pstmt.setString(13,(String) employeeData.get("employee_landline"));
pstmt.setString(14,(String) employeeData.get("employee_mobile"));
pstmt.setString(15,(String) employeeData.get("employee_email"));
pstmt.setString(16,(String) employeeData.get("employee_status"));
pstmt.setString(17,(String)
employeeData.get("employee_deparment"));
pstmt.setString(18,(String) employeeData.get("employee_dob"));
pstmt.setString(19,(String)
employeeData.get("employee_nationalty"));
record = pstmt.executeUpdate();
/// Get the Last Insert ID ///
rs = pstmt.getGeneratedKeys();
if(rs.next())
{
last_inserted_id = rs.getInt(1);
}
pstmt.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
while(rs.next())
{
resultsArray.put("employee_id",rs.getString("employee_id"));
resultsArray.put("employee_user",rs.getString("employee_user"));
resultsArray.put("employee_level",rs.getString("employee_level"));
resultsArray.put("employee_sal",Integer.parseInt(rs.getString("employee_sal")));
resultsArray.put("employee_first_name",rs.getString("employee_first_name"));
resultsArray.put("employee_middle_name",rs.getString("employee_middle_name"))
;
resultsArray.put("employee_last_name",rs.getString("employee_last_name"));
resultsArray.put("employee_gender",rs.getString("employee_gender"));
resultsArray.put("employee_address",rs.getString("employee_address"));
resultsArray.put("employee_village",rs.getString("employee_village"));
resultsArray.put("employee_state",Integer.parseInt(rs.getString("employee_state"))
);
resultsArray.put("employee_country",Integer.parseInt(rs.getString("employee_coun
try")));
resultsArray.put("employee_landline",rs.getString("employee_landline"));
resultsArray.put("employee_mobile",rs.getString("employee_mobile"));
resultsArray.put("employee_email",rs.getString("employee_email"));
resultsArray.put("employee_status",Integer.parseInt(rs.getString("employee_status
")));
resultsArray.put("employee_deparment",Integer.parseInt(rs.getString("employee_d
eparment")));
resultsArray.put("employee_dob",rs.getString("employee_dob"));
resultsArray.put("employee_nationalty",rs.getString("employee_nationalty"));
count++;
}
if(count==0)
{
resultsArray.put("employee_id","");
resultsArray.put("employee_user","");
resultsArray.put("employee_level","");
resultsArray.put("employee_sal",0);
resultsArray.put("employee_first_name","");
resultsArray.put("employee_middle_name","");
resultsArray.put("employee_last_name","");
resultsArray.put("employee_gender","");
resultsArray.put("employee_address","");
resultsArray.put("employee_village","");
resultsArray.put("employee_state",0);
resultsArray.put("employee_country",0);
resultsArray.put("employee_landline","");
resultsArray.put("employee_mobile","");
resultsArray.put("employee_email","");
resultsArray.put("employee_status",0);
resultsArray.put("employee_deparment",0);
resultsArray.put("employee_dob","");
resultsArray.put("employee_nationalty","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultsArray;
}
int record=0;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) employeeData.get("employee_sal"));
pstmt.setString(2,(String)
employeeData.get("employee_first_name"));
pstmt.setString(3,(String)
employeeData.get("employee_middle_name"));
pstmt.setString(4,(String)
employeeData.get("employee_last_name"));
pstmt.setString(5,(String)
employeeData.get("employee_gender"));
pstmt.setString(6,(String)
employeeData.get("employee_address"));
pstmt.setString(7,(String)
employeeData.get("employee_village"));
pstmt.setString(8,(String)
employeeData.get("employee_state"));
pstmt.setString(9,(String)
employeeData.get("employee_country"));
pstmt.setString(10,(String)
employeeData.get("employee_landline"));
pstmt.setString(11,(String)
employeeData.get("employee_mobile"));
pstmt.setString(12,(String)
employeeData.get("employee_email"));
pstmt.setString(13,(String)
employeeData.get("employee_status"));
pstmt.setString(14,(String)
employeeData.get("employee_deparment"));
pstmt.setString(15,(String)
employeeData.get("employee_dob"));
pstmt.setString(16,(String)
employeeData.get("employee_nationalty"));
pstmt.setString(17,(String) employeeData.get("employee_id"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
public boolean deleteEmployee(int employee_id)
{
return true;
}
while(rs.next())
{
HashMap results = new HashMap();
results.put("employee_id",rs.getString("employee_id"));
results.put("employee_user",rs.getString("employee_user"));
results.put("employee_level",rs.getString("employee_level"));
results.put("employee_sal",rs.getString("employee_sal"));
results.put("employee_first_name",rs.getString("employee_first_name"));
results.put("employee_middle_name",rs.getString("employee_middle_name"));
results.put("employee_last_name",rs.getString("employee_last_name"));
results.put("employee_gender",rs.getString("employee_gender"));
results.put("employee_address",rs.getString("employee_address"));
results.put("employee_village",rs.getString("employee_village"));
results.put("employee_state",rs.getString("employee_state"));
results.put("employee_country",rs.getString("employee_country"));
results.put("employee_landline",rs.getString("employee_landline"));
results.put("employee_mobile",rs.getString("employee_mobile"));
results.put("employee_email",rs.getString("employee_email"));
results.put("employee_status",Integer.parseInt(rs.getString("employee_status")));
results.put("employee_deparment",Integer.parseInt(rs.getString("employee_depar
ment")));
results.put("employee_dob",rs.getString("employee_dob"));
results.put("employee_nationalty",rs.getString("employee_nationalty"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return resultArray;
}
{
SQL = "SELECT status_name FROM status WHERE status_id = "+status_id
;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
value = rs.getString("status_name");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return value;
}
}
import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;
try
{
pstmt = connection.prepareStatement(SQL,
Statement.RETURN_GENERATED_KEYS);
pstmt.setString(1,(String) feesData.get("fees_student_id"));
pstmt.setString(2,(String) feesData.get("fees_month"));
pstmt.setString(3,(String) feesData.get("fees_amount"));
pstmt.setString(4,(String) feesData.get("fees_date"));
record = pstmt.executeUpdate();
ResultSet rs = pstmt.getGeneratedKeys();
if(rs.next())
{
int last_inserted_id = rs.getInt(1);
error = Integer.toString(last_inserted_id);
}
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
//////////////////Function for getting Fees Details//////////
results.put("fees_student_id",Integer.parseInt(rs.getString("fees_student_id")));
results.put("fees_month",Integer.parseInt(rs.getString("fees_month")));
results.put("fees_amount",rs.getString("fees_amount"));
results.put("fees_date",Integer.parseInt(rs.getString("fees_date")));
count++;
}
if(count==0)
{
results.put("fees_id","");
results.put("fees_student_id",0);
results.put("fees_month",0);
results.put("fees_amount","");
results.put("fees_date","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return results;
}
int record=0;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) feesData.get("fees_student_id"));
pstmt.setString(2,(String) feesData.get("fees_month"));
pstmt.setString(3,(String) feesData.get("fees_amount"));
pstmt.setString(4,(String) feesData.get("fees_date"));
pstmt.setString(5,(String) feesData.get("fees_id"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
results.put("fees_student_id",Integer.parseInt(rs.getString("fees_student_id")));
results.put("fees_month",Integer.parseInt(rs.getString("fees_month")));
results.put("fees_amount",rs.getString("fees_amount"));
results.put("fees_date",rs.getString("fees_date"));
results.put("student_name",rs.getString("student_first_name")+"
"+rs.getString("student_middle_name")+" "+rs.getString("student_last_name"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultArray;
}
Coding of Login.java
package Model;
import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;
if(count==1)
{
SQL = "UPDATE login SET login_password=? WHERE
login_id=?";
int record=0;
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,new_password);
pstmt.setInt(2,1);
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
}
catch(Exception e)
{
System.out.println(" Error : "+ e.toString());
}
if(count==0)
return false;
return true;
}
//////////////////Function for geting the Single Airport Details//////////
public boolean checkLogin(String login_user,String login_password)
{
int count=0;
try
{
resultsArray.put("login_emp_id",rs.getString("login_emp_id"));
resultsArray.put("login_user",rs.getString("login_user"));
resultsArray.put("login_level",rs.getString("login_level"));
count++;
}
if(count==0)
{
resultsArray.put("login_id","");
resultsArray.put("login_emp_id","");
resultsArray.put("login_user","");
resultsArray.put("login_level","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultsArray;
}
}
Coding of Salary.java
package Model;
import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) salaryData.get("sal_employe_id"));
pstmt.setString(2,(String) salaryData.get("sal_month"));
pstmt.setString(3,(String) salaryData.get("sal_year"));
pstmt.setString(4,(String) salaryData.get("sal_amount"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
//////////////////Function for getting Users Details//////////
public HashMap getSalaryDetails(int sal_id)
{
HashMap results = new HashMap();
int count=0;
try
{
String SQL = "SELECT * FROM salary WHERE sal_id = "+sal_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
results.put("sal_id",rs.getString("sal_id"));
results.put("sal_employe_id",Integer.parseInt(rs.getString("sal_employe_id")));
results.put("sal_year",rs.getString("sal_year"));
results.put("sal_month",Integer.parseInt(rs.getString("sal_month")));
results.put("sal_amount",rs.getString("sal_amount"));
count++;
}
if(count==0)
{
results.put("sal_id","");
results.put("sal_employe_id",0);
results.put("sal_year","");
results.put("sal_month",0);
results.put("sal_amount","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return results;
}
int record=0;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) salaryData.get("sal_employe_id"));
pstmt.setString(2,(String) salaryData.get("sal_year"));
pstmt.setString(3,(String) salaryData.get("sal_month"));
pstmt.setString(4,(String) salaryData.get("sal_amount"));
pstmt.setString(5,(String) salaryData.get("sal_id"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
results.put("sal_employe_id",Integer.parseInt(rs.getString("sal_employe_id")));
results.put("sal_year",rs.getString("sal_year"));
results.put("sal_month",Integer.parseInt(rs.getString("sal_month")));
results.put("sal_amount",rs.getString("sal_amount"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultArray;
}
/////Function for Getting the List////////////
public String getMonthOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("month","month_id","month_name","month_id,month_name
",selectedID,"1");
}
/////Function for Getting the List////////////
public String getEmployeeOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("employee","employee_id","employee_id","employee_id,emp
loyee_id",selectedID,"1");
}
Coding of Student.java
package Model;
import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) studentData.get("student_user"));
pstmt.setString(2,(String) studentData.get("student_password"));
pstmt.setString(3,(String) studentData.get("student_level"));
pstmt.setString(4,(String) studentData.get("student_sal"));
pstmt.setString(5,(String) studentData.get("student_first_name"));
pstmt.setString(6,(String) studentData.get("student_middle_name"));
pstmt.setString(7,(String) studentData.get("student_last_name"));
pstmt.setString(8,(String) studentData.get("student_gender"));
pstmt.setString(9,(String) studentData.get("student_address"));
pstmt.setString(10,(String) studentData.get("student_village"));
pstmt.setString(11,(String) studentData.get("student_state"));
pstmt.setString(12,(String) studentData.get("student_country"));
pstmt.setString(13,(String) studentData.get("student_landline"));
pstmt.setString(14,(String) studentData.get("student_mobile"));
pstmt.setString(15,(String) studentData.get("student_email"));
pstmt.setString(16,(String) studentData.get("student_status"));
pstmt.setString(17,(String) studentData.get("student_deparment"));
pstmt.setString(18,(String) studentData.get("student_dob"));
pstmt.setString(19,(String) studentData.get("student_nationalty"));
record = pstmt.executeUpdate();
/// Get the Last Insert ID ///
rs = pstmt.getGeneratedKeys();
if(rs.next())
{
last_inserted_id = rs.getInt(1);
}
pstmt.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
resultsArray.put("student_user",rs.getString("student_user"));
resultsArray.put("student_level",rs.getString("student_level"));
resultsArray.put("student_sal",Integer.parseInt(rs.getString("student_sal")));
resultsArray.put("student_first_name",rs.getString("student_first_name"));
resultsArray.put("student_middle_name",rs.getString("student_middle_name"));
resultsArray.put("student_last_name",rs.getString("student_last_name"));
resultsArray.put("student_gender",rs.getString("student_gender"));
resultsArray.put("student_address",rs.getString("student_address"));
resultsArray.put("student_village",rs.getString("student_village"));
resultsArray.put("student_state",Integer.parseInt(rs.getString("student_state")));
resultsArray.put("student_country",Integer.parseInt(rs.getString("student_country"
)));
resultsArray.put("student_landline",rs.getString("student_landline"));
resultsArray.put("student_mobile",rs.getString("student_mobile"));
resultsArray.put("student_email",rs.getString("student_email"));
resultsArray.put("student_status",Integer.parseInt(rs.getString("student_status")));
resultsArray.put("student_deparment",Integer.parseInt(rs.getString("student_depar
ment")));
resultsArray.put("student_dob",rs.getString("student_dob"));
resultsArray.put("student_nationalty",rs.getString("student_nationalty"));
count++;
}
if(count==0)
{
resultsArray.put("student_id","");
resultsArray.put("student_user","");
resultsArray.put("student_level","");
resultsArray.put("student_sal",0);
resultsArray.put("student_first_name","");
resultsArray.put("student_middle_name","");
resultsArray.put("student_last_name","");
resultsArray.put("student_gender","");
resultsArray.put("student_address","");
resultsArray.put("student_village","");
resultsArray.put("student_state",0);
resultsArray.put("student_country",0);
resultsArray.put("student_landline","");
resultsArray.put("student_mobile","");
resultsArray.put("student_email","");
resultsArray.put("student_status",0);
resultsArray.put("student_deparment",0);
resultsArray.put("student_dob","");
resultsArray.put("student_nationalty","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultsArray;
}
int record=0;
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) studentData.get("student_sal"));
pstmt.setString(2,(String)
studentData.get("student_first_name"));
pstmt.setString(3,(String)
studentData.get("student_middle_name"));
pstmt.setString(4,(String)
studentData.get("student_last_name"));
pstmt.setString(5,(String) studentData.get("student_gender"));
pstmt.setString(6,(String)
studentData.get("student_address"));
pstmt.setString(7,(String) studentData.get("student_village"));
pstmt.setString(8,(String) studentData.get("student_state"));
pstmt.setString(9,(String) studentData.get("student_country"));
pstmt.setString(10,(String)
studentData.get("student_landline"));
pstmt.setString(11,(String)
studentData.get("student_mobile"));
pstmt.setString(12,(String) studentData.get("student_email"));
pstmt.setString(13,(String) studentData.get("student_status"));
pstmt.setString(14,(String)
studentData.get("student_deparment"));
pstmt.setString(15,(String) studentData.get("student_dob"));
pstmt.setString(16,(String)
studentData.get("student_nationalty"));
pstmt.setString(17,(String) studentData.get("student_id"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
results.put("student_id",rs.getString("student_id"));
results.put("student_user",rs.getString("student_user"));
results.put("student_level",rs.getString("student_level"));
results.put("student_sal",rs.getString("student_sal"));
results.put("student_first_name",rs.getString("student_first_name"));
results.put("student_middle_name",rs.getString("student_middle_name"));
results.put("student_last_name",rs.getString("student_last_name"));
results.put("student_gender",rs.getString("student_gender"));
results.put("student_address",rs.getString("student_address"));
results.put("student_village",rs.getString("student_village"));
results.put("student_state",rs.getString("student_state"));
results.put("student_country",rs.getString("student_country"));
results.put("student_landline",rs.getString("student_landline"));
results.put("student_mobile",rs.getString("student_mobile"));
results.put("student_email",rs.getString("student_email"));
results.put("student_status",Integer.parseInt(rs.getString("student_status")));
results.put("student_deparment",Integer.parseInt(rs.getString("student_deparment
")));
results.put("student_dob",rs.getString("student_dob"));
results.put("student_nationalty",rs.getString("student_nationalty"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer );
e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return resultArray;
}
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
value = rs.getString("jt_name");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return value;
}
value = rs.getString("category_name");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return value;
}
}
Bibliography
Credentialreview.html
Database Programming with JDBC and Java by O'Reilly
Head First Java 2nd Edition
http://www.jdbc-tutorial.com/
Java and Software Design Concepts by Apress