You are on page 1of 128

A

PROJECT REPORT
ON

Submitted towards the partial fulfillment of the requirement


For the award of the degree of
BACHELOR OF COMPUTER APPLICATION (BCA)

SUBMITTED BY UNDER GUIDANCE


Utkarsh Srivastava (Roll no. 8558164) Dr. Pramod Sharma
Akshay (Roll no. 8558008)

SHRI RAM COLLEGE, M.NAGAR


AFFILIATED TO CH. CHARANS SINGH, UNIVERSITY, MEERUT

1
2
CONTENTS

Title of the Project 1


Index 2
Acknowledgement 4
Declaration 5
Introduction 6
Scope of The System 7
Project Description 7
Implementation of project 8
Advantages of Project 8
Project category Tools & Environment
Project Category 10
Front end Coverage 11
Back end Coverage 12
Software and Hardware Requirements 13
Project Development stages
Recognition of needs 14
Feasibility study 14
System Analysis (structure of Data table etc) 17
System Analysis (DFDs E-R Diagram) 21
System Development 29
Testing, Implementation & maintenance 29
Project form
Snap Shot 31
Coding 51
Testing & Debugging 115
Module 121
Future Enhancement 122
Conclusion 125

3
Bibliography 127

4
ACKNOWLEDGEMENT

We would like to take this opportunity to express our gratitude towards all the people
who have in various ways, helped in the successful completion of our project.
We must convey our gratitude to Mr. Pramod Sharma for giving us the constant
source of inspiration and help in preparing the project, personally correcting our work
and providing encouragement throughout the project.
We also thank all our faculties members for steering us through the tough as well as
easy phases of the project in a result oriented manner with concern attention.

DATE

Signature of the students


Utkarsh Srivastava
Akshay

5
DECLARATION

This is to certify that the dissertation project report entitled ROADWAYS


MANAGEMENT SYSTEM is an authentic work carried out for the partial
fulfillment of the Bachelors Degree of Computer Application under the guidance of
Mr.Pramod Sharma The matter embodied in this project work has not been submitted
earlier for award of any degree or diploma to the best of my knowledge and belief.

Signature of the students


Utkarsh Srivastava
Akshay

6
INTRODUCTION

One must know what the problem is before it can be solved as necessary is the mother
of invention & of course, if we dont know where to go, we will not know when we will
have reached there. The basis for a candidate system is recognition of a need for
improving an information system or a procedure. This need leads to a preliminary
survey or an initial investigation. It entails looking into the duplication of efforts,
inefficient existing procedures etc.
The main problem in the Roadways managemet System is to handle the daily bus time
table. There are two basic processes that are bus and staff are used in this project. In
addition to these two processes, records have to be maintained about bus, staff
members, bus time table, daily expenses. In manual process consume lots of time to
complete the purchasing and selling process. The solution of this is to automate the
processes of bus time table

7
Scope of the system :

1. To provide security as only an authorized employee can interact with the system.
2. To help the staff in working easily and efficiently.
3. To help the staff in reducing errors that are encountered frequently during
manual operations by concurrently updating the data stored in many places.
4. To reduce the workload on the staff by providing automatic calculation.
5. To help the staff or manager in tracing the transaction quickly.
6. To help the staff in generating various reports at various nick of time as per their
requirements e.g. daily, weekly, monthly or annually.
7. To reduce the manpower.
8. To maintain the data with complete consistency and minimum redundancy.

One must know what the problem is before it can be solved as necessary is the mother
of invention & of course, if we dont know where to go, we will not know when we will
have reached there. The basis for a candidate system is recognition of a need for
improving an information system or a procedure. This need leads to a preliminary
survey or an initial investigation. It entails looking into the duplication of efforts,
inefficient existing procedures etc.

The main problem in the Roadways managemet System is to handle the daily bus time
table. There are two basic processes that are bus and staff are used in this project. In
addition to these two processes, records have to be maintained about bus, staff
members, bus time table, daily expenses. In manual process consume lots of time to
complete the purchasing and selling process. The solution of this is to automate the
processes of bus time table

1.2 Project Description:

This project primarily achieves the following objectives on-line:-


1. To help the company staff in working easily and efficiently.

8
2. To help the company staff in providing better service to the student and staff
members in a Reasonable time i.e. to process their requests quickly without wasting
time in Forming long queues by students to get their job done.

3. To reduce the load of work on the company staff by providing automatic generation
of the reports etc.

4. To help the company staff in generating reports about students and staff as well.

5. To help the company staff in reducing errors that is encountered frequently during
manual operations.

6. To provide security as only an authorized user can interact with the system.

1.3 SYSTEM IMPLEMANTATION


Implementation, literally, means to put into effects or to carry out. The system
implementation phase of software engineering deals with all activities that take place to
convert from the old system to the new. Proper implementation is essential to provide
system to meet organizations requirements.

During the implementation phase debugging, documentation of the system was created
out, module in the project for

Accuracy of Results,
Minimization of response Time,
Clarity and Simplicity of the code,
Minimization of hard Coding i.e. (a generic approach was followed)
Minimization of amount of memory used.

Various types of errors were discovered while debugging the modules. These ranged
from errors to failure to account for various processing cases. Proper documentation of
each module was done by embedding comments in the executable portion of the code.
To enhance the readability, comments, indentation, parenthesis, block spaces, blank
lines and borders were around the blocks of comments. Care was taken to use

9
descriptive names for table, field modules, forms etc. The proper use of indentation,
parenthesis and blank lines was also ensured during coding.

Testing of the report Generation module was carried out to find out the response time of
the system for the generating reports. To make the response time negligible.

1.4 Advantage of Project:

The purpose of this project is to convey the requirements of the project (as specified by
the client) to the programmers to ensure that the programmers understand and fulfill the
requirements to the expectation of the client.

Secondly, this project is used to ensure that the development team understands the
requirements specified by the client. This document will act as the contract for all future
development; all development spawns from and adheres to the details in the
requirements. The SRS also outlines the performance requirements that may be set and
required by the client/user.

This is the Software requirement specification for theRoadways Management


System Project. This document provides a description of the purpose, functionality and
interface of the software designed by the developer with input of the project. In this
Software Requirement Specification, constraints and other design issues are addressed.

10
PROJECT CATEGORY TOOLS & ENVIRONMENT

2.1 Project Category:

or company or any institution, the several employees have to maintain a number of


records in various part of the organization. In a market, there is a need to maintain
record Today computer has become the backbone of nearly every occupation. In every
industry about employees, edibles, assets & many more.

To do this work manually requires a lot of manpower and consumes too much time.
Moreover one is never sure about the efficiency & accuracy of work being done and
records being maintained. A bad part of this style of working is that, if a person
concerned for a particular job, say maintaining supplier record, is on leave, some of the
process gets standstill, which depends on the records kept by that employee. That is,
where automation comes in to help and allows simple, smooth and most efficient,
secure and easy to handle functionality.

This system will reduce the workload of the employee and time of processing of data
from one unit to another. It also will help the staff/manager in tracing the daily
transaction like purchasing of raw materials & selling edibles to customer to maintain
staff record, asset information to reduce the manpower. It also provides the facility to
prevent the unauthorized data access of other persons by categorized the user as normal
user and administrator. Only administrator can delete & even modify the records.

This system will prove to be master key to manage of a supermarket. Now days all the
organizations are converting from manual to computerized transactions. This provides
better services to the employees with less effort thus increasing the demand of this type
of system day by day.

This project ROADWAYS MANAGEMENT SYSTEM will help the staff & stands
at their command in every sphere of their activities regarding a Customer booking. It
will be always their back & call.

2.1 Front End coverage:

11
FRONT END

JAVA NETBEANS developed by Sun Microsystems Company. JAVA can use a large
number of reference libraries and components. Java the environment-provides
integration with a variety of other tools, including source code management, component
reuse tools and data manipulation. Java truly is much more of a programming
environment than just a language. using this environment ,a single developer can
quickly create a simple application; a team of developers can create a so sophisticated,
distributed application.

Features in Java net beans

Data access
Internet features
Controls
Component creation
Language
Wizards

Java has evolved to be much more than a language-it is an application producing


machine. no other development environment on the planet provides as wide a variety
of capabilities in the box as Java. Even though Java is much more productive than other
tools, it also requires more discipline to produce clean design. A key to improving your
programming technique is to embrace the capabilities to create classes and Java.

As system becomes more complex and distributed, no single tool can address all of the
needs of the system. Java provides the development environments with the raw tools
needed to build small systems well as components of large system.

If we look at all of the new features and functions added to the 6.0 release of the Java, a
couple of themes become evident: the internet and the database

12
BACK END

A database is a collection of information thats related to a particular subject or purpose,


such as tracking customer orders or maintaining a music collection .If your database
isnt stored on a computer, or only parts of it are , you may be tracking information from
a variety of sources that you have having to coordinate and organize yourself.

For example, suppose the phone numbers of your suppliers are stored in various
locations: in a card file containing supplier phone numbers, in product information file
cabinet, and in a spreadsheet containing order information .if a suppliers phone number
changes, you might have to update that information in all three places in database,
however, you only have to update that information in one place- the suppliers phone
number is automatically updated wherever you use it in database.

Using Microsoft Access, you can manage all your information from a single database
file. Within the file, you can use:

Tables to store your data.


Queries to find and retrieve just the data you want
Forms to view add and update data in tables.
Reports to analyze or print data in a specific layout.
Data access pages to view, update, or analyze the databases data from the internet
or an intranet.

13
2.3 Sotfware and Hardware Requirement

FRONT END : JAVA NETBEANS

BACK END : MS ACCESS 2007

PLATFORM : WINDOWS-XP /2000/2003./Windows 7

PROCESSOR : PENTIUM 3 OR HIGHER PROCESSOR

OPERATING SYSTEM : MICROSOFT WINDOWS 98 OR XP

RAM MEMORY : 128MB

MONITOR : VGA MONITOR OR HIGH RESOLUTION MONITER

HARD DISK : 1GB OF FREE SPACE REQUIRED

DISPLAY : VGA CARD

KEYBOARD : 104 KEYS

14
PROJECT DEVELOPMENT STAGE

3.1 RECOGNITION OF NEEDS:-


A system can be defined as A set of arrangement of elements that
are organized to accomplish some method, procedure or control by
processing information.

System Analysis stages down the broad frame work of strategy stage into its minute
details. This is the stage where intensive user interaction assumes a lot of importance.
It is also a major point when we develop software. We also consider about time, how
much time software place to complete because for a big organization time factor is
money for full successful of the software also Tax some times so we have consider from
starting to last that means beginning to software.

3.2 FEASIBILITY STUDY:-


Feasibility study before development or customization of software we think
following of the major points, which includes following: -

Economical
Technical
Duration

3.2.1 Economical:-
This study about the software basically give the suggestion like if we develop software

for our organization than how much it will forfeitable, workable as well as economical.

If we developing a software which very economical but not profitable there it is also

wrong decision. So for we economical study about the system table following of the

point.

How much costing of the software?


What is the output of the customization?

15
What are the advantages in c0ompression manual we check
whether it is time or not?
Whether it is use friendly or not?
It is mountable for long term.
Understanding about the software
Corrective of software.

3.2.2 Technical:-
We also consider some technical points about development of software.
We see whether the software is reliable or not.
Whether it is work time for long time or not.
What are the languages as well as OS is used for development of software.
It provides security or not.
Software is reusable or not.
Software is updated or not.
Software is flexible or not whether software can maintain.

3.2.3 Duration:-
It is also a major point when we develop software. We also consider about time, how
much time software place to complete because for a big organization time factor is
money for full successful of the software also Tax some times so we have consider from
starting to last that means beginning to software.

3.3 System Analysis:-


Systems analysis refers to the process of examining a business situation with the intent
of improving it through better procedure and methods. Systems development can
generally be thought of as having two major componenets:Systems Analysis and
Systems Design.

Systems analysis is the process of gathering and interpreting facts, diagnosis problems
and using the information to recommend improvement to the system.In brief, we can
say that analysis specifies what the system should do.

16
I. System analysis is conducted with the following objectives in mind:
II. Identify the Student and Staff members need
III. Evaluate the system concept for feasibility
IV. Perform economic and technical analysis
V. Allocate function to hardware,software, people, database and other system
elements
VI. Establish cost and schedule constraints
Create a system definition that forms the foundation for all subsequent engeneering

17
18
List of Tables:
Login table
Bustable
Stafftable
Timetable

1. Login table
Field Name Data Type
Login name Text

Password Text

2. Staff Table
Field Name Data Type

Staffid Number
S_Name Text
ADDRESS Text
PHONE Text

19
Time Table

Field Name Data Type

Sno Number
Busno Text
Regno Text
Fuel Text
staffid1 Number
Staffname 1 Text
Address 1 Text
Contact no 1 Number
Staff id 2 Number
Staff name2 Text
Address 2 Text
`contact no2 Number
Arrival time Text
Departure time Text
Station from Text
Viastation Text

20
21
3.3.1 DATA FLOW DIAGRAM:
A Data Flow Diagram (DFD) is a graphical tool used to describe and analyze the
movement of data through a system - manual or automated including the processes,
stores of data and delays in the system. They are central tools and the basis from which
other components are developed. It depicts the transformation of data, independent of
the physical components, from input to output through logical processes and the
interaction between processes.

DFDs are an excellent mechanism of communicating with the customers and are
widely used for representing external and top-level internal design specification. In the
later situations, DFDs are quite valuable for establishing naming conventions and
names of system components such as subsystems, files and data links.
In a DFD there are four components:
Sources or Destinations of data such as human, entities that interact with system,
outside the system boundary, who form the source and the recipient of information are
depicted in the form of a closed rectangle.
Data flow is a packet of data. It identifies data flow. It is a pipeline through which
information flows. It is depicted in DFD as an arrow with the pointer pointing in the
direction of flow. This connecting symbol connects an entity, process and data stores.
This arrow mark also specifies the sender and the receiver.
Process depicts procedure, function or module that transforms input data into output
data. It is represented as a circle or a bubble with the procedure name and a unique
number inside the circle.
Data stores are the physical areas in the computers hard disk where groups of related
data are stored in the form of files. They are depicted as an open-ended rectangle. The
Data store is used either for storing data into the files or for reference purposes.

22
DFD FOR USER LOGIN

1 User_id
USER

Accessing User
Information
Invalid Pasword
Validity
Process
Process

Valid User for Type


Matching

User Type
Invalid User Type
Validity
Process
Matched

23
DFD OF BUSES

t BUSES
Vehicle data being processed

Data Validity
Process
1 Vehicle1
Invalid Vehicle
data

2 Vehicle2

24
DFD FOR DRIVER

DRIVER
1 DRIVER LIST

Accessing Driver Info

Searching Driver
data

Invalid Driver

Display
Valid Driver for

o
display

Pr

25
DFD FOR TIME TABLE

BUSES
1 List of buses
Bus Data

Searching available
Vehicle

Invalid Bus no

Time sarrangement
Valid Bus no

26
27
3.3.2 ENTITY RELATIONSHIP DIAGRAM

The entity relationship (E R) data model is based on a perception of a real world that
consists of a collection of basic objects, called entities, and of relationships among these
objects. An entity is a thing or objects in the real world that is distinguishable from other
objects. Entities are described in database by a set of attributes.

A relationship is an association among several entities. The set of all entities of the same
type and the set of all relationships of the same type are termed as entity set and
relationship set, respectively.

The overall logical structure (schema) of a database can be expressed graphically by an


E-R Diagram, which is built up from the following components:

Rectangles, which represents entity sets.

Ellipses, which represents attributes.

Diamonds, which represents relationships among entity sets.

Lines, which link attributes to entity sets and entity sets to relationships.

28
NAME ADDRESS
FUEL RENT
Orderno. COMPANY

PHONE NAME
REG.NO

DRIVER
BUS
DID
VNO

COLOR

contains
has

TIME
ARRANGEMENT

STATION FROM
BUS NO

TIME TABLE

STATION TO

TIME

DID
VIA STATION

29
3.5 System Development:-
Development Phase, translates a set of requirements into an operational system that we
call Software. At early stages of hardware development a hardware engineer does
not reach for a soldering iron, similarly the Software engineer
should not reach the compiler. Design is accomplished first.
The first phase of development concentrates on design. The design phase for

software with a description of architecture and data design. That is a modular structure

is developed first, interfaces are defined and data structure is established. Design criteria

are used for the assessment of quality. This preliminary design step is reviewed for

completeness and tractability to software requirements.

Procedural aspects of each modular component of the software design are considered

next, and is following by the CODING the generation of program using an appropriate

programming language or CASE tool occurs after the design is complete. Software

engineering methodology views coding as a consequence of good design. Code is then

reviewed for style and clarity, but should otherwise be directly traceable to a detailed

design description.

3.6 SYSTEM IMPLEMANTATION


Implementation, literally, means to put into effects or to carry out. The system
implementation phase of software engineering deals with all activities that take place to
convert from the old system to the new. Proper implementation is essential to provide
system to meet organizations requirements.

During the implementation phase debugging, documentation of the system was created
out, module in the project for

Accuracy of Results,
Minimization of response Time,

30
Clarity and Simplicity of the code,
Minimization of hard Coding i.e. (a generic approach was followed)
Minimization of amount of memory used.

Various types of errors were discovered while debugging the modules. These ranged
from errors to failure to account for various processing cases. Proper documentation of
each module was done by embedding comments in the executable portion of the code.
To enhance the readability, comments, indentation, parenthesis, block spaces, blank
lines and borders were around the blocks of comments. Care was taken to use
descriptive names for table, field modules, forms etc. The proper use of indentation,
parenthesis and blank lines was also ensured during coding.

Testing of the report Generation module was carried out to find out the response time of
the system for the generating reports. To make the response time negligible.

31
32
Login form

33
Splash form

34
Main form

35
Add bus form

36
Delete bus form

37
Modify bus form

38
Search bus form

39
Add staff form

40
Delete staff form

41
Modify staff form

42
Search staff form

43
Set time table form

44
Delete form

45
Modify time table form

46
Search form

47
48
List of bus report

49
List of staff report

50
List of time table report

51
52
Login form

package roadwayess;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;

private void okActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
String u1,u2,p1,p2;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
String query="select * from logintable";
ResultSet res=state.executeQuery("select * from logintable");
res.next();
u1=(res.getString("loginname"));
p1=(res.getString("password"));
u2=u.getText();
p2=p.getText();
if(u1.equals(u2)&& p1.equals(p2)) {
dispose();
Spleshform ob = new Spleshform();
ob.show();
}

else
JOptionPane.showMessageDialog(null, "InCorrect");
{

u.setText("");
p.setText("");

53
u.requestFocus();
if(i==3)
System.exit(0);

}
} catch(Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage());
}
}

private void okKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(ch==KeyEvent.VK_ENTER) {

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();

String lname1, lname2, pass1, pass2, query;


query="select * from logintable";
ResultSet res=state.executeQuery(query);
res.next();
lname1=res.getString("loginname");
pass1=res.getString("password");
lname2=u.getText();
pass2=p.getText();
if(lname1.equals(lname2)&&pass1.equals(pass2)) {
Spleshform obj=new Spleshform();
dispose();
obj.show();
}

54
else
JOptionPane.showMessageDialog(null,"incorrect");
{
i++;
u.setText("");
p.setText("");
u.requestFocus();
if(i==3)
System.exit(0);
}
} catch(Exception e) {
JOptionPane.showMessageDialog(null,e.getMessage());
}

}
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
System.exit(0);
}

private void pKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(ch==KeyEvent.VK_ENTER) {
evt.consume();
ok.requestFocus();
}
}

55
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LoginWindow().setVisible(true);
}
});
}

Splash Form

package roadwayess;
import javax.swing.*;
import java.awt.*;

private void contiMouseMoved(java.awt.event.MouseEvent evt) {


// TODO add your handling code here:
conti.setBackground(Color.WHITE);
}

private void contiActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
dispose();
MainForm ob =new MainForm();
ob.setVisible(true);
}

private void jPanel2MouseMoved(java.awt.event.MouseEvent evt) {


// TODO add your handling code here:
conti.setBackground(Color.ORANGE);
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {

56
public void run() {
new Spleshform().setVisible(true);
}
});
}

Main form

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
AddBusForm ob=new AddBusForm();
ob.setVisible(true);
}

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
ModifyBusEntry ob =new ModifyBusEntry();
ob.setVisible(true);
}

private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
DeleteBusForm ob=new DeleteBusForm();
ob.setVisible(true);
}

private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
SearchBusForm ob=new SearchBusForm();
ob.setVisible(true);
}

private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

57
Addnewstaff ob=new Addnewstaff();
ob.setVisible(true);
}

private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
ModifyStaffEntry ob=new ModifyStaffEntry();

ob.setVisible(true);

private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
DeleteStaffEntry ob=new DeleteStaffEntry();
ob.setVisible(true);
}

private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
SearchStaffEntry ob=new SearchStaffEntry();
ob.setVisible(true);
}

private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
System.exit(0);
}

private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
AddnewTimetable ob=new AddnewTimetable();
ob.setVisible(true);
}

58
private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Modifytimetable ob=new Modifytimetable();
ob.setVisible(true);
}

private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
Deletetimetable ob=new Deletetimetable();
ob.setVisible(true);
}

private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
Searchtimetable ob =new Searchtimetable();
ob.setVisible(true);
}

private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
ListOfBus ob=new ListOfBus();
ob.setVisible(true);
}

private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
ListOfStaff ob=new ListOfStaff();
ob.setVisible(true);
}

private void jMenu4ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

59
private void jMenuItem17ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Listoftimetable ob=new Listoftimetable();
ob.setVisible(true);
}

private void jMenuItem18ActionPerformed(java.awt.event.ActionEvent evt) {


changepass obj=new changepass();
obj.show();
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainForm().setVisible(true);
}
});
}

60
Add bus form

package roadwayess;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;

private void saveActionPerformed(java.awt.event.ActionEvent evt) {


try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();

int tcno;
String tname,taddress,tphone;
tcno=Integer.parseInt(txtsno.getText());
tname=txtname.getText();
taddress=txtaddress.getText();
tphone=txtphone.getText();
String query;
query="insert into bustable
values("+tcno+",'"+tname+"','"+taddress+"','"+tphone+"')";
state.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Successfully saved");
}catch(Exception e) {
JOptionPane.showMessageDialog(null,"Invalid data or Duplicate sno not
allowed" );
}
}

private void clearActionPerformed(java.awt.event.ActionEvent evt) {


txtsno.setText("");
txtname.setText("");
txtaddress.setText("");

61
txtphone.setText("");
txtsno.requestFocus();
int pno=0;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from bustable");
while(res.next()) {
pno=res.getInt("busno");
pno=res.getInt("regno");
}
txtsno.setText(String.valueOf(pno+1));
txtname.setText(String.valueOf(pno+1));
txtsno.enable(false);
txtname.enable(false);
txtaddress.requestFocus();
} catch(Exception e) {
}
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
int pno=0;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from bustable");
while(res.next()) {
pno=res.getInt("busno");
pno=res.getInt("regno");
}
txtsno.setText(String.valueOf(pno+1));

62
txtname.setText(String.valueOf(pno+1));
txtsno.enable(false);
txtname.enable(false);
txtaddress.requestFocus();
}
catch(Exception e)
{}
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new AddBusForm().setVisible(true);
}
});
}

Delete bus form

package roadwayess;
import java.sql.*;
import javax.swing.*;

private void exitActionPerformed(java.awt.event.ActionEvent evt) {


dispose();
}

private void comboActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int cid;
String s=String.valueOf(combo.getSelectedItem());
cid=Integer.parseInt(s);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

63
Connection c=DriverManager.getConnection("jdbc:odbc:road");
state=c.createStatement();

String query;
query="select * from bustable where busno="+cid+"";
ResultSet res =state.executeQuery(query);
if( res.next()) {
txtname.setText(res.getString("regno"));
txtaddress.setText(res.getString("totalseat"));
txtphone.setText(res.getString("fueltype"));

}
} catch(Exception e) {
}
}

private void deleteActionPerformed(java.awt.event.ActionEvent evt) {


int choice,no;
choice=JOptionPane.showConfirmDialog(null,"Delete it");
String s=String.valueOf(combo.getSelectedItem());
no=Integer.parseInt(s);
if (choice==JOptionPane.YES_OPTION) {
try {
state.executeUpdate("delete from bustable where busno="+no);

txtname.setText("");
txtaddress.setText("");
txtphone.setText("");

JOptionPane.showMessageDialog(null,"Successfully deleted");
combo.removeAllItems();

} catch(Exception e) {
}

64
}
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:road");
state=c.createStatement();
String query;
query="select * from bustable";
ResultSet res =state.executeQuery(query);
while(res.next())
{
combo.addItem(res.getString("busno"));
}
}
catch(Exception e)
{}
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new DeleteBusForm().setVisible(true);
}
});
}

65
Modify bus form

package roadwayess;
import javax.swing.*;
import java.sql.*;

private void exitActionPerformed(java.awt.event.ActionEvent evt) {


dispose();
}

private void comboActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int cid;
String s = String.valueOf(combo.getSelectedItem());
cid=Integer.parseInt(s);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
state=c.createStatement();

String query;
query="select * from bustable where busno="+cid+"";
ResultSet res =state.executeQuery(query);
if( res.next()) {
txtname.setText(res.getString("regno"));
txtaddress.setText(res.getString("totalseat"));
txtphone.setText(res.getString("fueltype"));

}
} catch(Exception e) {
}
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {

66
// TODO add your handling code here:
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");

state=c.createStatement();
String query;
query="select * from bustable";
ResultSet res =state.executeQuery(query);
while(res.next())
{
combo.addItem(res.getString("busno"));
}
}
catch(Exception e)
{}
}

private void updateActionPerformed(java.awt.event.ActionEvent evt) {


try {

String tname,taddress,tphone,query;
int bno;
tname=txtname.getText();
taddress=txtaddress.getText();
tphone=txtphone.getText();
String s=String.valueOf(combo.getSelectedItem());
bno=Integer.parseInt(s);
query="update bustable set
regno="+tname+",totalseat="+taddress+",fueltype='"+tphone+"'where
busno="+bno+"";
state.executeUpdate(query);

67
JOptionPane.showMessageDialog(null,"Successfully updated");

}catch(Exception e) {
JOptionPane.showMessageDialog(null,"Invalid data");
}
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ModifyBusEntry().setVisible(true);
}
});
}

Search bus form

package roadwayess;
import javax.swing.*;
import java.sql.*;
import javax.swing.table.*;

private void op1ActionPerformed(java.awt.event.ActionEvent evt) {


lbl.setText("Enter bus no ");
txt.setText("");
txt.requestFocus();
}
private void op2ActionPerformed(java.awt.event.ActionEvent evt) {
lbl.setText("Enter register no ");
txt.setText("");
txt.requestFocus();
}

68
private void txtActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void SEARCHActionPerformed(java.awt.event.ActionEvent evt) {


DefaultTableModel m=(DefaultTableModel) tb.getModel();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:road");
state=c.createStatement();

String query;
ResultSet res;
//Removing all rows;
int rows=m.getRowCount();
for(int i=0;i<rows;i++) {
m.removeRow(0);

}
if (op1.isSelected()) {
s=Integer.parseInt(txt.getText());
query="select * from bustable where busno="+s;
res=state.executeQuery(query);
while(res.next()) {
m.addRow(new Object[]
{ res.getString("busno"),res.getString("regno"),res.getString("totalseat"),res.getString("f
ueltype")});
}
} else if (op2.isSelected()) {
s=Integer.parseInt(txt.getText());
query="select * from bustable where regno="+s;
res=state.executeQuery(query);
while(res.next()) {

69
m.addRow(new Object[]
{ res.getString("busno"),res.getString("regno"),res.getString("totalseat"),res.getString("f
ueltype")});
}
}
{}
} catch(Exception e) {
JOptionPane.showMessageDialog(null,"Invalid data");

}
}

private void EXITActionPerformed(java.awt.event.ActionEvent evt) {


dispose();
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SearchBusForm().setVisible(true);
}
});
}

70
Add staff form

package roadwayess;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;

private void saveActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int no,salary,licenceno;
String name,cno,address,post,dt;
no=Integer.parseInt(txtid.getText());
salary=Integer.parseInt(txtsalary.getText());
licenceno=Integer.parseInt(txtlno.getText());
dt=txtjd.getText();
name=txtname.getText();
post=txtpost.getText();
cno=txtcno.getText();
address=txtaddress.getText();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:road");
Statement state=con.createStatement();
String query;
query="Insert into stafftable
values("+no+",'"+name+"','"+address+"','"+cno+"',"+salary+",'"+post+"','"+dt+"',"+licen
ceno+")";
state.executeUpdate(query);
JOptionPane.showMessageDialog(null, "Sucessfully Saved");
} catch(Exception e) {
}
}

private void nextActionPerformed(java.awt.event.ActionEvent evt) {

71
// TODO add your handling code here:
txtname.setText("");
txtaddress.setText("");
txtcno.setText("");
txtsalary.setText("");
txtpost.setText("");
txtjd.setText("");
txtlno.setText("");
int pno=0;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from stafftable");
while(res.next()) {
pno=res.getInt("staffid");
}

txtid.setText(String.valueOf(pno+1));
txtid.enable(false);
txtname.requestFocus();
} catch(Exception e) {
}
}

private void exitActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
dispose();
}

private void txtsalaryKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();

72
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtpost.requestFocus();
}

private void txtpostKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtjd.requestFocus();
}
}

private void txtjdKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_SLASH)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtlno.requestFocus();
}

73
}

private void txtlnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
save.requestFocus();
}
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Addnewstaff().setVisible(true);
}
});
}

74
Delete staff form

package roadwayess;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;
private void txtnameKeyTyped(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtname.requestFocus();
}
}

private void txtcnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtcno.requestFocus();
}
}

private void txtaddressKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
}

75
private void exitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
dispose();
}

private void txtsalaryKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtpost.requestFocus();
}
}

private void txtpostKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtjd.requestFocus();
}
}

private void txtjdKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();

76
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_SLASH)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtlno.requestFocus();
}

private void txtlnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
delete.requestFocus();
}
}

private void combo1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int sno;
String s=String.valueOf(combo1.getSelectedItem());
sno=Integer.parseInt(s);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from stafftable where
staffid="+sno+"");
if(res.next()) {
txtname.setText(res.getString("staffname"));

77
txtaddress.setText(res.getString("address"));
txtcno.setText(res.getString("contectno"));
txtsalary.setText(res.getString("salary"));
txtpost.setText(res.getString("post"));
txtjd.setText(res.getString("dateofjoining"));
txtlno.setText(res.getString("licenceno"));
}
} catch(Exception e) {
}
}

private void deleteActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int sid;
String s=String.valueOf(combo1.getSelectedItem());
sid=Integer.parseInt(s);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
String query;
query="delete * from stafftable where staffid="+sid+"";
state.executeUpdate(query);
txtname.setText("");
txtaddress.setText("");
txtcno.setText("");
txtsalary.setText("");
txtpost.setText("");
txtjd.setText("");
txtlno.setText("");
JOptionPane.showMessageDialog(null, "Sucessfully Deleted");
combo1.removeAllItems();

78
} catch(Exception e) {
}
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:road");
Statement state=con.createStatement();
ResultSet res=state.executeQuery("select * from stafftable");
while(res.next())
{
combo1.addItem(res.getString("staffid"));
}
}
catch(Exception e)
{}
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new DeleteStaffEntry().setVisible(true);
}
});
}

Modify staff form

79
package roadwayess;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;

private void txtnameKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtname.requestFocus();
}
}

private void txtcnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtcno.requestFocus();
}
}

private void txtaddressKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
}

private void exitActionPerformed(java.awt.event.ActionEvent evt) {

80
// TODO add your handling code here:
dispose();
}

private void txtsalaryKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtpost.requestFocus();
}
}

private void txtpostKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtjd.requestFocus();
}
}

private void txtjdKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_SLASH)) {

81
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtlno.requestFocus();
}

private void txtlnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
update1.requestFocus();
}
}

private void combo1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int sno;
String s=String.valueOf(combo1.getSelectedItem());
sno=Integer.parseInt(s);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from stafftable where
staffid="+sno+"");
if(res.next()) {
txtname.setText(res.getString("staffname"));
txtaddress.setText(res.getString("address"));

82
txtcno.setText(res.getString("contectno"));
txtsalary.setText(res.getString("salary"));
txtpost.setText(res.getString("post"));
txtjd.setText(res.getString("dateofjoining"));
txtlno.setText(res.getString("licenceno"));
}
} catch(Exception e) {
}
}

private void update1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int sid,salary,licenceno;
String s=String.valueOf(combo1.getSelectedItem());
sid=Integer.parseInt(s);
String name,cno,address,post,dt;
salary=Integer.parseInt(txtsalary.getText());
licenceno=Integer.parseInt(txtlno.getText());
dt=txtjd.getText();
name=txtname.getText();
post=txtpost.getText();
cno=txtcno.getText();
address=txtaddress.getText();

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
String query;
query="update stafftable set
staffname='"+name+"',address='"+address+"',contectno='"+cno+"',salary="+salary+",po
st='"+post+"',dateofjoining='"+dt+"',licenceno="+licenceno+" where staffid="+sid+"";
state.executeUpdate(query);
JOptionPane.showMessageDialog(null, "Sucessfully Update");

83
combo1.removeAllItems();
} catch(Exception e) {
}
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:road");
Statement state=con.createStatement();
ResultSet res=state.executeQuery("select * from stafftable");
while(res.next())
{
combo1.addItem(res.getString("staffid"));
}
}
catch(Exception e)
{}
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ModifyStaffEntry().setVisible(true);
}
});
}

Serach staff form

package roadwayess;

84
import javax.swing.*;
import java.sql.*;
import javax.swing.table.*;
private void op1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
lbl.setText("Enter the staff id");
sid.setText("");
sid.requestFocus();
}

private void op2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
lbl.setText("Enter the staff name");
sid.setText("");
sid.requestFocus();
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
DefaultTableModel m=(DefaultTableModel) tb.getModel();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement sate=c.createStatement();
ResultSet res;
String query;
int row=m.getRowCount();
for(int i=0;i<row;i++) {
m.removeRow(0);
}
if(op1.isSelected()) {
int s=Integer.parseInt(sid.getText());
query="select * from stafftable where staffid="+s;
res=sate.executeQuery(query);

85
while(res.next()) {
m.addRow(new Object[]
{res.getString("staffid"),res.getString("staffname"),res.getString("address"),res.getStrin
g("contectno"),res.getString("salary"),res.getString("post"),res.getString("dateofjoining"
),res.getString("licenceno")});

}
} else if(op2.isSelected()) {
String s=sid.getText();
query="select * from stafftable where staffname='"+s+"'";
res=sate.executeQuery(query);
while(res.next()) {
m.addRow(new Object[]
{res.getString("staffid"),res.getString("staffname"),res.getString("address"),res.getStrin
g("contectno"),res.getString("salary"),res.getString("post"),res.getString("dateofjoining"
),res.getString("licenceno")});
}
}
{}
} catch(Exception e) {
JOptionPane.showMessageDialog(null, "Not Found");
}
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
dispose();
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SearchStaffEntry().setVisible(true);
}

86
});
}

Add time table form

package roadwayess;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;

private void comboActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int cid;
String s = String.valueOf(combo.getSelectedItem());
cid=Integer.parseInt(s);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();

String query;
query="select * from bustable where busno="+cid+"";
ResultSet res =state.executeQuery(query);
if( res.next()) {
txtrno.setText(res.getString("regno"));
txtts.setText(res.getString("totalseat"));
txtftype.setText(res.getString("fueltype"));

}
} catch(Exception e) {
}
}

private void txtnameKeyTyped(java.awt.event.KeyEvent evt) {

87
// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtrno.requestFocus();
}
}

private void txtcnoActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void txtcnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtcno.requestFocus();
}
}

private void txtlnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");

88
evt.consume();
txtname .requestFocus();
}
}

private void combo2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int sno;
String s=String.valueOf(combo2.getSelectedItem());
sno=Integer.parseInt(s);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from stafftable where
staffid="+sno+"");
if(res.next()) {
txtname.setText(res.getString("staffname"));
txtcno.setText(res.getString("contectno"));
txtlno.setText(res.getString("licenceno"));
}
} catch(Exception e) {
}
}

private void txtarrivelActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void txtdeptActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void exitActionPerformed(java.awt.event.ActionEvent evt) {

89
dispose();
}

private void clearActionPerformed(java.awt.event.ActionEvent evt) {


txtsrno.setText("");
combo.removeItem("");
txtrno.setText("");
txtts.setText("");
txtftype.setText("");
combo2.removeItem("");
txtname.setText("");
txtcno.setText("");
txtlno.setText("");
txtarrivel.setText("");
txtdept.setText("");
txtfrom.setText("");
txtstto.setText("");
txtviast.setText("");

int pno=0;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from timingtable");
while(res.next()) {
pno=res.getInt("srno");

}
txtsrno.setText(String.valueOf(pno+1));
txtsrno.enable(false);
combo.requestFocus();

} catch(Exception e) {

90
}
}

private void saveActionPerformed(java.awt.event.ActionEvent evt) {


int srno,rgno,total,lno;
String bno,fuel,sid,name,cno,arrivel,depart,from,to,via;
bno=String.valueOf(combo.getSelectedItem());
srno=Integer.parseInt(txtsrno.getText());
rgno=Integer.parseInt(txtrno.getText());
fuel=txtftype.getText();
total=Integer.parseInt(txtts.getText());
sid=String.valueOf(combo2.getSelectedItem());
name=txtname.getText();
cno=txtcno.getText();
lno=Integer.parseInt(txtlno.getText());
arrivel=txtarrivel.getText();
depart=txtdept.getText();
from=txtfrom.getText();
to=txtstto.getText();
via=txtviast.getText();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
String query;
query="insert into timingtable
values("+srno+",'"+bno+"',"+rgno+","+total+",'"+fuel+"','"+sid+"','"+name+"','"+cno+"',
"+lno+",'"+arrivel+"','"+depart+"','"+from+"','"+to+"','"+via+"')";
state.executeUpdate(query);
JOptionPane.showMessageDialog(null, "Sucessfully Saved");

91
catch (Exception e)
{}

private void formWindowOpened(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");

Statement state=c.createStatement();
String query;
query="select * from bustable";
ResultSet res =state.executeQuery(query);
while(res.next())
{
combo.addItem(res.getString("busno"));
}
}
catch(Exception e)
{}
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:road");
Statement state=con.createStatement();
ResultSet res=state.executeQuery("select * from stafftable");
while(res.next())
{
combo2.addItem(res.getString("staffid"));
}
}

92
catch(Exception e)
{}
int pno=0;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement state=c.createStatement();
ResultSet res=state.executeQuery("select * from timingtable");
while(res.next()) {
pno=res.getInt("srno");

}
txtsrno.setText(String.valueOf(pno+1));
txtsrno.enable(false);

} catch(Exception e) {
}
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new AddnewTimetable().setVisible(true);
}
});
}

Delete time table form

package roadwayess;
import java.sql.*;
import javax.swing.*;
import java.awt.event.*;

93
public class Deletetimetable extends javax.swing.JFrame {
Connection c;
Statement state;
int s;

/** Creates new form Deletetimetable */


public Deletetimetable() {
initComponents();
}
private void exitActionPerformed(java.awt.event.ActionEvent evt) {
dispose();
}

private void deleteActionPerformed(java.awt.event.ActionEvent evt) {


int choice,no;
choice=JOptionPane.showConfirmDialog(null,"Delete it");
String s=String.valueOf(combo.getSelectedItem());
no=Integer.parseInt(s);
if (choice==JOptionPane.YES_OPTION) {
try {
state.executeUpdate("delete from timingtable where srno="+no);

txtbno.setText("");
txtrno.setText("");
txtts.setText("");
txtftype.setText("");
txtsid.setText("");
txtname.setText("");
txtcno.setText("");
txtlno.setText("");
txtarrivel.setText("");
txtdept.setText("");

94
txtfrom.setText("");
txtstto.setText("");
txtviast.setText("");

JOptionPane.showMessageDialog(null,"Successfully deleted");
combo.removeAllItems();

} catch(Exception e) {
}

}
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:road");

state=c.createStatement();
String query;
query="select * from timingtable";
ResultSet res =state.executeQuery(query);
while(res.next())
{
combo.addItem(res.getString("srno"));
}
}
catch(Exception e)
{}

95
}

private void comboActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int cid;
String h = String.valueOf(combo.getSelectedItem());
cid=Integer.parseInt(h);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:road");
state=c.createStatement();

String query;
query="select * from timingtable where srno="+cid+"";
ResultSet res =state.executeQuery(query);
if( res.next()) {

txtbno.setText(res.getString("bno"));
txtrno.setText(res.getString("regno"));
txtts.setText(res.getString("totalseats"));
txtftype.setText(res.getString("fueltype"));
txtsid.setText(res.getString("staffid"));
txtname.setText(res.getString("staffname"));
txtcno.setText(res.getString("staffphone"));
txtlno.setText(res.getString("lincenceno"));
txtarrivel.setText(res.getString("arriveltime"));
txtdept.setText(res.getString("departuretime"));
txtfrom.setText(res.getString("stationfrom"));
txtstto.setText(res.getString("stationto"));
txtviast.setText(res.getString("stationvia"));

}
} catch(Exception e) {
}

96
}

private void txtnameKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtrno.requestFocus();
}
}

private void txtcnoActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void txtcnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtcno.requestFocus();
}
}

private void txtlnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();

97
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtname .requestFocus();
}
}

private void txtsidKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
}

private void txtarrivelActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void txtdeptActionPerformed(java.awt.event.ActionEvent evt) {


}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Deletetimetable().setVisible(true);
}
});
}

Modify time table form

package roadwayess;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;

98
public class Modifytimetable extends javax.swing.JFrame {
Connection c;
Statement state;
int s;

/** Creates new form Modifytimetable */


public Modifytimetable() {
initComponents();
}
private void exitActionPerformed(java.awt.event.ActionEvent evt) {
dispose();
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:road");

state=c.createStatement();
String query;
query="select * from timingtable";
ResultSet res =state.executeQuery(query);
while(res.next())
{
combo.addItem(res.getString("srno"));
}
}
catch(Exception e)
{}
}

private void updateActionPerformed(java.awt.event.ActionEvent evt) {

99
try {
int sno,rgno,total,lno;
String bno,fuel,sid,name,cno,arrivel,depart,from,to,via;
bno=txtbno.getText();
String d=String.valueOf(combo.getSelectedItem());
sno=Integer.parseInt(d);
rgno=Integer.parseInt(txtrno.getText());
fuel=txtftype.getText();
total=Integer.parseInt(txtts.getText());
sid=txtsid.getText();
name=txtname.getText();
cno=txtcno.getText();
lno=Integer.parseInt(txtlno.getText());
arrivel=txtarrivel.getText();
depart=txtdept.getText();
from=txtfrom.getText();
to=txtstto.getText();
via=txtviast.getText();

String query;
query="update timingtable set
bno='"+bno+"',regno="+rgno+",totalseats="+total+",fueltype='"+fuel+"',staffid="+sid+"
,staffname='"+name+"',staffphone='"+cno+"',lincenceno="+lno+",arriveltime='"+arrivel
+"',departuretime='"+depart+"',stationfrom='"+from+"',stationto='"+to+"',stationvia='"+
via+"' where srno="+sno+"";
state.executeUpdate(query);

JOptionPane.showMessageDialog(null,"Successfully updated");

}catch(Exception e) {
JOptionPane.showMessageDialog(null,"Invalid data");
}

100
}

private void txtnameKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z'||ch==KeyEvent.VK_SPACE||
ch==KeyEvent.VK_BACK_SPACE||ch==KeyEvent.VK_ENTER)) {
JOptionPane.showMessageDialog(null, "Invalid Name.");
evt.consume();
txtrno.requestFocus();
}
}

private void txtcnoActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void txtcnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtcno.requestFocus();
}
}

private void txtlnoKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
char ch;
ch=evt.getKeyChar();

101
if(!(ch>='0'&&ch<='9'||ch==KeyEvent.VK_ENTER||
ch==KeyEvent.VK_BACK_SPACE)) {
JOptionPane.showMessageDialog(null, "Invalid No.");
evt.consume();
txtname .requestFocus();
}
}

private void txtarrivelActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void txtdeptActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void comboActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int cid;
String h = String.valueOf(combo.getSelectedItem());
cid=Integer.parseInt(h);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection("jdbc:odbc:road");
state=c.createStatement();

String query;
query="select * from timingtable where srno="+cid+"";
ResultSet res =state.executeQuery(query);
if( res.next()) {

txtbno.setText(res.getString("bno"));
txtrno.setText(res.getString("regno"));
txtts.setText(res.getString("totalseats"));

102
txtftype.setText(res.getString("fueltype"));
txtsid.setText(res.getString("staffid"));
txtname.setText(res.getString("staffname"));
txtcno.setText(res.getString("staffphone"));
txtlno.setText(res.getString("lincenceno"));
txtarrivel.setText(res.getString("arriveltime"));
txtdept.setText(res.getString("departuretime"));
txtfrom.setText(res.getString("stationfrom"));
txtstto.setText(res.getString("stationto"));
txtviast.setText(res.getString("stationvia"));

}
} catch(Exception e) {
}

private void txtsidKeyTyped(java.awt.event.KeyEvent evt) {


// TODO add your handling code here:
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Modifytimetable().setVisible(true);
}
});
}

Search time table form

package roadwayess;
import javax.swing.*;
import java.sql.*;

103
import javax.swing.table.*;

private void op1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
lbl.setText("Enter the Serial no");
sid.setText("");
sid.requestFocus();
}

private void op2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
lbl.setText("Enter the Bus Id");
sid.setText("");
sid.requestFocus();
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
DefaultTableModel m=(DefaultTableModel) tb.getModel();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement sate=c.createStatement();
ResultSet res;
String query;
int row=m.getRowCount();
for(int i=0;i<row;i++) {
m.removeRow(0);
}
if(op1.isSelected()) {
int s=Integer.parseInt(sid.getText());
query="select * from timingtable where srno="+s;
res=sate.executeQuery(query);
while(res.next()) {

104
m.addRow(new Object[]
{res.getString("srno"),res.getString("bno"),res.getString("regno"),res.getString("totalsea
ts"),res.getString("fueltype"),res.getString("staffid"),res.getString("staffname"),res.getSt
ring("staffphone"),res.getString("lincenceno"),res.getString("arriveltime"),res.getString(
"departuretime"),res.getString("stationfrom"),res.getString("stationto"),res.getString("st
ationvia")});

}
} else if(op2.isSelected()) {
String s=sid.getText();
query="select * from timingtable where bno='"+s+"'";
res=sate.executeQuery(query);
while(res.next()) {
m.addRow(new Object[]
{res.getString("srno"),res.getString("bno"),res.getString("regno"),res.getString("totalsea
ts"),res.getString("fueltype"),res.getString("staffid"),res.getString("staffname"),res.getSt
ring("staffphone"),res.getString("lincenceno"),res.getString("arriveltime"),res.getString(
"departuretime"),res.getString("stationfrom"),res.getString("stationto"),res.getString("st
ationvia")});
}
}
{}
} catch(Exception e) {

}
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
dispose();
}

public static void main(String args[]) {

105
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Searchtimetable().setVisible(true);
}
});
}

106
List of bus

package roadwayess;
import javax.swing.*;
import java.sql.*;
import javax.swing.table.*;

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
dispose();
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
DefaultTableModel m=(DefaultTableModel) tb.getModel();
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement sate=c.createStatement();
ResultSet res;
String query;
int row=m.getRowCount();
for(int i=0;i<row;i++)
{
m.removeRow(0);
}

query="select * from bustable";


res=sate.executeQuery(query);
while(res.next())
{

107
m.addRow(new Object[]
{ res.getString("busno"),res.getString("regno"),res.getString("totalseat"),res.getString("f
ueltype")});

}
}
catch(Exception e)
{}
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ListOfBus().setVisible(true);
}
});
}

108
List of staff

package roadwayess;
import javax.swing.*;
import java.sql.*;
import javax.swing.table.*;

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
dispose();
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
DefaultTableModel m=(DefaultTableModel) tb.getModel();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement sate=c.createStatement();
ResultSet res;
String query;
int row=m.getRowCount();
for(int i=0;i<row;i++) {
m.removeRow(0);
}

query="select * from stafftable";


res=sate.executeQuery(query);
while(res.next()) {
m.addRow(new Object[]
{res.getString("staffid"),res.getString("staffname"),res.getString("address"),res.getStrin
g("contectno"),res.getString("salary"),res.getString("post"),res.getString("dateofjoining"
),res.getString("licenceno")});

109
}
}
catch(Exception e)
{}
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ListOfStaff().setVisible(true);
}
});
}

List of time table

package roadwayess;
import java.sql.*;
import javax.swing.table.*;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
dispose();
}

private void formWindowActivated(java.awt.event.WindowEvent evt) {


// TODO add your handling code here:
DefaultTableModel m=(DefaultTableModel) tb.getModel();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:road");
Statement sate=c.createStatement();
ResultSet res;
String query;
int row=m.getRowCount();

110
for(int i=0;i<row;i++) {
m.removeRow(0);
}

query="select * from timingtable";


res=sate.executeQuery(query);
while(res.next()) {
m.addRow(new Object[]
{res.getString("srno"),res.getString("bno"),res.getString("regno"),res.getString("totalsea
ts"),res.getString("fueltype"),res.getString("staffid"),res.getString("staffname"),res.getSt
ring("staffphone"),res.getString("lincenceno"),res.getString("arriveltime"),res.getString(
"departuretime"),res.getString("stationfrom"),res.getString("stationto"),res.getString("st
ationvia")});

}
}
catch(Exception e)
{}
}

111
Change password form

package roadwayess;
import java.sql.*;
import javax.swing.*;

private void varify2ActionPerformed(java.awt.event.ActionEvent evt) {


String lname,pass;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:road");
Statement state=con.createStatement();
ResultSet res=state.executeQuery("select * from logintable");
res.next();
lname=res.getString(1);
pass=res.getString(2);
if (lname.equals(txtlogin2.getText()) && pass.equals(txtpass2.getText())) {
JOptionPane.showMessageDialog(null, "Enter New Loginnaeme and
Password");
txtnewlogin.requestFocus();

} else {
int val;
val=JOptionPane.showConfirmDialog(null, "Incorrect, Try again");
if(val==JOptionPane.NO_OPTION ) {
System.exit(0);

}
} catch(Exception t) {
}
}

112
private void OKActionPerformed(java.awt.event.ActionEvent evt) {
String lname,pass,repass,query;
lname=txtnewlogin.getText();
pass=txtnewpass.getText();
repass=txtrpass.getText();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:road");
Statement state=con.createStatement();
if(pass.equals(repass)) {
query="update logintable set loginname= '"+lname+"',password='"+pass+"'";
state.executeUpdate(query);
JOptionPane.showMessageDialog(null, "Successfully Saved");
txtnewlogin.setText("");
txtnewpass.setText("");
txtlogin2.setText("");
txtpass2.setText("");
txtrpass.setText("");

}
if(lname.equals("")) {
JOptionPane.showMessageDialog(null, "Invalid Username");
}

} catch(Exception t) {
}
}

private void EXIT1ActionPerformed(java.awt.event.ActionEvent evt) {


dispose();
}

113
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new changepass().setVisible(true);
}
});
}

114
115
TESTING & DEBUGGING

TESTING

It should be clear in mind that the philosophy behind testing is to find errors. Test cases
are devised with this purpose in mind. A test case is a set of data that the system will
process as normal input. However, the data are created with the express intent of
determining whether the system will process them correctly. For example, test cases for
inventory handling should include situations in which the quantifies to be withdrawn
from inventory exceed, equal and are less than the actual quantities on hand. Each test
case is designed with the intent of finding errors in the way the system will process it.
There are two general strategies for testing software: Code testing and Specification
testing. In code testing, the analyst develops that cases to execute every instructions and
path in a program. Under specification testing, the analyst examines the program
specifications and then writes test data to determine how the program operates under
specific conditions. Regardless of which strategy the analyst follows, there are preferred
practices to ensure that the testing is useful. The levels of tests and types of test data,
combined with testing libraries, are important aspects of the actual test process.

Levels of Testing
Systems are not designed as entire systems nor are they tested as single systems. The
analyst must perform both unit and system testing.

Unit Testing:

In unit testing the analyst tests the programs making up a system. For this reason, unit
testing is sometimes called program testing. Unit testing gives stress on the modules
independently of one another, to find errors. This helps the tester in detecting errors in
coding and logic that are contained within that module alone. The errors resulting from
the interaction between modules are initially avoided. For example, a hotel information
system consists of modules to handle reservations; guest checking and checkout;
restaurant, room service and miscellaneous charges; convention activities; and accounts

116
receivable billing. For each, it provides the ability to enter, modify or retrieve data and
respond to different types of inquiries or print reports. The test cases needed for unit
testing should exercise each condition and option.

Unit testing can be performed from the bottom up, starting with smallest and lowest-
level modules and proceeding one at a time. For each module in bottom-up testing a
short program is used to execute the module and provides the needed data, so that the
module is asked to perform the way it will when embedded within the larger system.

System Testing:

The important and essential part of the system development phase, after designing and
developing the software is system testing. We cannot say that every program or system
design is perfect and because of lack of communication between the user and the
designer, some error is there in the software development. The number and nature of
errors in a newly designed system depend on some usual factors like communication
between the user and the designer; the programmer's ability to generate a code that
reflects exactly the systems specifications and the time frame for the design.

Theoretically, a newly designed system should have all the parts or sub-systems are in
working order, but in reality, each sub-system works independently. This is the time to
gather all the subsystem into one pool and test the whole system to determine whether it
meets the user requirements. This is the last change to detect and correct errors before
the system is installed for user acceptance testing. The purpose of system testing is to
consider all the likely variations to which it will be subjected and then push the system
to its limits.

Testing is an important function to the success of the system. System testing makes a
logical assumption that if all the parts of the system are correct, the goal will be
successfully activated. Another reason for system testing is its utility as a user-oriented
vehicle before implementation.

System testing consists of the following five steps:


1) Program testing

117
2) String testing
3) System testing
4) System documentation
5) User acceptance testing

Program Testing:

A program represents the logical elements of a system. For a program to run


satisfactorily, it must compile and test data correctly and tie in properly with other
programs. it is the responsibility of a programmer to have an error free program. At the
time of testing the system, there exists two types of errors that should be checked. These
errors are syntax and logic. A syntax error is a program statement that violates one or
more rules of the language in which it is written. An improperly defined field dimension
or omitted key words are common syntax errors. These errors are shown through error
messages generated by the computer. A logic error, on the other hand, deals with
incorrect data fields out of range items, and invalid combinations. Since the logical
errors are not detected by compiler, the programmer must examine the output carefully
to detect them.

When a program is tested, the actual output is compared with the expected output.
When there is a discrepancy, the sequence of the instructions, must be traced to
determine the problem. The process is facilitated by breaking the program down into
self-contained portions, each of which can be checked at certain key points.

String Testing:

Programs are invariably related to one another and interact in a total system. Each
program is tested to see whether it conforms to related programs in the system. Each
part of the system is tested against the entire module with both test and live data before
the whole system is ready to be tested.

118
System Testing:

System testing is designed to uncover weaknesses that were not found in earlier tests.
This includes forced system failure and validation of total system as it will be
implemented by its user in the operational environment. Under this testing, generally we
take low volumes of transactions based on live data. This volume is increased until the
maximum level for each transaction type is reached. The total system is also tested for
recovery and fallback after various major failures to ensure that no data are lost during
the emergency. All this is done with the old system still in operation. When we see that
the proposed system is successful in the test, the old system is discontinued.

System Documentation:

All design and test documentation should be well prepared and kept in the library for
future reference. The library is the central location for maintenance of the new system.

User Acceptance Testing:

An acceptance test has the objective of selling the user on the validity and reliability of
the system. It verifies that the system's procedures operate to system specifications and
that the integrity of important data is maintained. Performance of an acceptance test is
actually the user's show. User motivation is very important for the successful
performance of the system. After that a comprehensive test report is prepared. This
report shows the system's tolerance, performance range, error rate and accuracy.

Special Systems Tests:

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.

119
Storage Testing: It determines the capacity of the system to store transaction data on a
disk or in other files. For example, verify documentation statements that the system will
store 10,000 records of 400 bytes length on a single flexible disk.

Performance Time Testing: it determines the length of time system used by the system
to process transaction data. This test is conducted prior to implementation to determine
how long it takes to get a response to an inquiry, make a backup copy of a file, or send a
transmission and get a response.

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.

Procedure Testing: It determines the clarity of documentation on operation and use of


system by having users do exactly what manuals request. For example, powering down
system at the end of week or responding to paper-out light on printer.

Human Factors Testing: It determines how users will use the system when processing
data or preparing reports.

DEBUGGING

This stage is the discovery & correction of programming errors. Few programs run
correctly the first time, so debugging is important & time-consuming stage of the
software development. Programming theorists & testing as verification & validation,
respectively. Verification ensures that the program does what the programmer intend to
do. It is the checking or testing of the items ,including software ,for conformance and
consistency with an associated specification. Validation ensures that the program
produces the correct results for a set of test data. It refers to the different set of activities
that ensures that the software that has been built is traceable to custom requirements.

BOEHM states these terms as

120
VERIFICATIONAre we building the product right?

VALIDATIONAre we building the right product?

The debugging of microprocessor programs is generally quite difficult because of the


inability to observe register contents directly, the primitive debugging aids, the close
interaction between hardware & software, the frequent dependence of programs on
precise timing, and the difficulty of obtaining adequate data for real-time applications,
The tools that can be used by programs with brief description are given below: -

121
.

MODULES AND THEIR PROCESS LOGICS

Process Name:- Buses

Description :- This process is for the new bus entry. This process displays the all
information about the Vehicle according to the selection criteria
of the bus.This process gives the facility of selecting different
types of query about the particular bus.

Process Name:- Staff

Description : This process displays the all information about the Driver
according to the selection criteria of the Driver.This process gives
the facility of selecting different types of query about the
particular Driver.

Process Name:- Time table arrangement.

Description :- This process is for the searching the entry of particular Buses for
Transportation.

Process Name:- Calculating bill

Description :- This process is for the calculating the bill

Process Name:- Report

122
Description :- This process is for the displaying the reports of Driver, Staff and Time
table etc.

123
124
Future Enhancement

This project was developed to fulfill user requirement; however there are lots of scope
to improve the performance of the roadways management System in the area of user
interface, database performance, and query processing time. Etc.

So there are many things for future enhancement of this project. The future
enhancements that are possible in the project are as follows.

Web Based interface for system administrator to add modify question bank,
which presently done from back end
Web based interface for generate reports, student test details for system
administrator
Linking and integration of other online educational web sites.
Integration with university database through Web Services
Connection to third-party OLAP applications
In the area of data security and system security.
Provide more online tips and help.
To optimize the query which is embedded in the system?

125
CONCLUSION

The project made me realize the significance of developing software for client,

where all the eventualities have to be taken care of, unlike at educational institution,

where the sole aim is to learn. What may be seen to the developed to be a software

complete in all respects, I was required to meet the stringent demands of the in-house

client in the materials department. Through this seemed tough at first, I realized that

pressure goaded us on to develop better and better applications.

During the project, the real importance for following all the principle of System
Analysis and Design drawled on me. I felt the necessity of going through the several
stages, because only such a process could make one understand the problems at hand,
more so due to the enormous size of data stores involved and their manipulation

In retrospect, I would like to say that the institute provided us with sample

opportunities to learn Oracle 8 and its tools. I specifically was able to learn MS-

ACCESS and its Tools. I specially was able to learn JAVA NETBEANS I also

succeeded in understanding a number of tricky concept in database, which were earlier

only hazy blobs in the realm of our comprehension. However my project library

management is an asset to the organization, even then FURTHER ENHANCEMENT

are possible in this project such as new forms & reports can be included as and when

required.

Unfortunately due to lack of time we can developed any report in this system but

this is not the end of this system software, it is beginning. We can change and modify

126
this software due to more requirements of needs and also removed some errors which

is finding in this system software.

We also developed some complex reports which is required and makes this

software more powerful and friendly for user by which user can handle library data

more easily and can calculate all the calculation without any other software i.e., users

all the requirements will be fulfill by this software and user can manage all the

numeric data calculations.

127
BIBLIOGRAPHY

The following are the books references that have been studied in the duration of making
of this project.

Microsoft SQL Server


Software Engineering (by k.k. Aggarwal )
Black book of Visual Basic 6.0 (by Holzner Steven)

WEB REFRENCES
www.microsoft.com
www.google.com
www.wekipedia.com

128

You might also like