You are on page 1of 117

WEBSITE FOR MTNL BROADBAND SERVICES

Page | 1

A project submitted in partial fulfillment of the requirement for Mahanagar Telephone Nagar Limited summer training 2009

Submitted to: MTNL(Mahanagar Telephone Nagar Limited) Sector-9,Rohini.

Page | 2

WEBSITE FOR MTNL BROADBAND SERVICES


(A Project Report For MTNL Summer Training 2009)

Made by: Chirag Kataria Rashi Aggarwal

Page | 3

INDEX
Preface Acknowledgement Introduction Objectives Justification and need of the system Advantages of the project Platform used System development life cycle Gantt chart System model Recognition of need Need Identification Feasibility study Cost-Benefit analysis System analysis Working environment Java Weblogic Oracle System design Database design ER-diagram Form design Coding Testing Maintenance Conclusion
Page | 4

Future prospects Bibliography

PREFACE
The website for MTNL Broadband Services is an application that is maintained in order to give a modern effective management for maintenance of broadband users account and giving the details of internet usage to the customers apart from providing other facilities like billing information. Computerization of broadband services is of great significance for making the complicated process of record maintenance as simple as possible using structured and modular design. Due to spurting of many books, the record maintenance of large number of customers has grown considerably. Though the whole work cannot be claimed to be project, the main purpose of this project is record maintenance and providing information about the number of MBs used, free MBs, various packages available and the billing information etc.

Page | 5

ACKNOWLEDGEMENT
The best part about completion of project are sense of achievement and that they offer a wonderful opportunity to thanks all those who are directly or indirectly associated with the project. This project was special it was undertaken as a requirements for the completion of summer training conducted by MTNL. Entire project development processes helps us grasp not just the technical details of the subject but also helped us understand the IT (Software Development) world and how people work here. We consider ourselves fortunate enough to be in right place with right person. We are very much obliged to our guide Mr. Vijay and _______ for their diligent support and invaluable guidance. We take this opportunity to express our deep sense of gratitude and hearty thank to the staff of MTNL for their valuable guidance, kind suggestion and constant encouragement.

Page | 6

Chirag Kataria Rashi Aggarwal

INTRODUCTION

The World-Wide Web (WWW) continues to grow at an astonishing rate. For a telecom company it is very important to be in touch with the customer and provide them a sense of care. Today almost every home in urban India is having a broadband connection. Various telecom companies are emerging at a fast pace with lucrative schemes. To come up and win the race with flying colours needs something extra. For this a company should treat its customers with timely offers, new packages etc. Above all, the services should be transparent. For example, a broadband company should tell the customers how much MBs they have used during each session. Apart from this, it should provide billing information so that if a customer havent received a months bill then he could check it from his account. This will save the customers time in going to MTNL office to check his bill and above all the tension to remember whether the months bill has arrived or not, whether he has paid it or not. He should be able to see which of his bills are fully paid, partially paid or unpaid.

Page | 7

In this project we are considering three types of users. Administrator is the person who will have all the controls under him. He can add, delete, update the record of a employee in the database. He can also do the addition, deletion and updation in the records of a customer. He will be the master of the website who can provide passwords to employees. He can view the lists like area wise customers, bill amount wise customers etc. Employee/User is the MTNL staff who can do the addition and deletion in the records of a customer apart from doing various updations. They can also see the lists like area wise customers, bill amount wise customers, status of bill etc.

Customer will be the person who is having the broadband connection. He will have the facility to check his bill information, do see the various packages available, to change his password for security reasons, to see his internet usage and the no. of MBs left if he is having a package providing free MBs.

Page | 8

ADVANTAGES OF THE PROJECT


Computerization makes the work of staff as well as customers easier, faster and manageable. Automation of any system makes it more reliable and efficient. Staff will not have to waste their time in doing so much paper work. Customers will now not have to wait to get their records made and updated by hands, which takes a lot of time. Thus time spend by a customer to get its work done is reduced. Also, the waiting time to get their records made and updated is reduced significantly. It is going to be advantageous for telecom company because they will have to pay half or even fewer employees, as the most of the work will be taken over by the computer.

Page | 9

PLATFORM USED
Hardware Requirement
1. Intel Core 2 Duo Processor 2. Color Monitor 3. Keyboard 4. 160 GB Hard Disk 5. 2 GB RAM 6. Compact Disk Drive

Software Requirement
1. Windows 9x 2. BEA Weblogic Platform 8.1 3. Oracle 9i 4. Notepad 5. Java Development kit

Front End Used Java Back End Used Oracle 9i


Page | 10

SYSTEM DEVELOPMENT LIFE CYCLE


The Systems Development Life Cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project from an initial feasibility study through maintenance of the completed application. Various phases involved in development: Recognition of need/Preliminary Investigation Feasibility Study System Analysis System Design Development of software System testing Implementation and Evaluation Maintenance

Page | 11

GANTT CHART

6 /9/2 0 0 96 /1 4 /20 09 /19 /200 9 6 6/24 /20 0 9 /29 /20 0 97 /4/20 0 9 7 /9/2 0 0 97/14 /200 9 6

R eco gnitio n o f need Feasibility S tudy A nalysis D esign D evelo pm ent T esting M aintenance S tart D ate D uratio n(days)

Page | 12

SYSTEM MODEL
There are various software development approaches defined and designed which are used/employed during development process of software, these approaches are also referred as "Software Development Process Models". Each process model follows a particular life cycle in order to ensure success in process of software development.

EVOLUTIONARY MODEL Evolutionary development is away of developing an initial development exposing it to the user component and refining it, with many versions, so as to develop an adequate system. There are basically three types of Evolutionary software process model:1. Incremental Model. 2. Spiral Model. 3. Component Based Model. During the project we have used Spiral Model. The description of model is as follows:-

Page | 13

The Spiral Model is an Evolutionary software process model that couples the iterative nature of prototyping with the controlled and systematic aspects of the linear sequential-model. Using the spiral model software is developed in a series of incremental releases. During early iterations the incremental release might be a paper model or prototype. During later iterations increasingly more complete versions of the engineered systems are produced. A Spiral model is divided into a number of framework activities also called task reasons. There are basically six task reasons they are:1. Customer communication. 2. Planning. 3. Risk Analysis. 4. Engineering. 5. Construction and release. 6. Customer evaluation.

Page | 14

Page | 15

The descriptions of these tasks are as follows:1. Customer communication: - Customer communication task required

establishing customer.

effective

communication

between

developer

and

2. Planning: - Planning task is to define resources, timelines and other

project and related information.


3. Risk Analysis: - Risk analysis task is required to access both

technical and management risk.


4. Engineering:-Engineering task requires building one or more

representation of the application.


5. Construction and release: - Construction and release task required

constructing, task, installation, and providing user support.


6. Customer Evaluation: - Customer Evaluation task required obtaining

customer feedback based on the evaluation of the software representation created during the installation stage. From fig. In this model the software engineering team moves around the spiral in a clockwise direction beginning at the center. The first circuit around the spiral model might result in the development of the product specification. Sub-sequent passes around the spiral might be used to develop a prototype and then progressively more sophisticated versions of the software.

Page | 16

RECOGNITION OF NEED
The first step is to identify a need for the new system. This will include determining whether a business problem or opportunity exists, conducting a feasibility study to determine if the proposed solution is cost effective, and developing a project plan. This process may involve end users who come up with an idea for improving their work. Ideally, the process occurs in tandem with a review of the organization's strategic plan to ensure that IT is being used to help the organization achieve its strategic objectives. Management may need to approve concept ideas before any money is budgeted for its development. Problem definition defines the user requirements,or what the user expects out of the system.This also includes a rough idea of the resource requirement for the project. The main objective of MTNL Broadband Services website System is to provide customers a easy and efficient way to see their internet usages, bill details, customer details etc. apart from helping the employees of MTNL in organizing and maintaining the records of customers efficiently. The records are automatically updated in the database when any transaction takes place.

Page | 17

A commonly used checklist for verifying requirements consists of the following:

Correct Simply put, does the requirement correctly reflect what the user wants?

Complete Ensure no elements are missing from the requirement, does the requirement describe all possible values, what about performance/security/accessibility aspects of a requirement?

Consistent Checking that there are no contradictions within the requirements.

Feasible Can the requirement be delivered given the technology, time and budget constraints.

Testable Is the expected result known and can it be programatically or visually verified?

Page | 18

NEED IDENTIFICATION

The main problem in an organization like a telecom industry is record maintenance of each and every customer and to provide each customer the details of its internet usage. Internet has entered in everyones life so a organization has to pace up with the world . Since there can be many intervals of internet usages everyday so a organization providing such facility should maintain a record for each and every interval for which internet is used , bill maintenance etc., therefore it is necessary to maintain large number of records. Moreover it is very difficult to use them for future references, therefore the need for website is felt.

Page | 19

FEASIBILITY STUDY
Feasibility study is a procedure that identifies, describes and evaluates the system. The objective of a feasibility study is to acquire a sense of its scope for solving the problem. Size of the project is determined. Costs and benefits are also estimated with greater accuracy at this stage. Preliminary analysis would examine the project feasibility, i.e. to evaluate whether it would be worthwhile to proceed with the project. The key considerations involved in the feasibility analysis are:

Technical Feasibility Economic Feasibility Behavioural Feasibility

Page | 20

TECHNICAL FEASIBILITY: It determines whether the technology needed for the proposed system is available and how it can be integrated within the organization. It also assess whether the staff have the expertise to assimilate and use the new technology. It is concerned with specifying equipment and software that will successfully support the required task.

ECONOMIC FEASIBILITY: The purpose of assessing economic feasibility is to identify the financial benefits and costs associated with the development project. It is also called Cost-Benefit Analysis.

BEHAVIOURAL FEASIBILITY: People are resistant to change so an estimate should be made of how strong a reaction the user staff is likely to have towards the development of proposed system.

Page | 21

COST-BENEFIT ANALYSIS
It is a tool for evaluating the effectiveness of the project. It may be used by the management to decide as to what extent benefits outweigh the costs. The costs associated with the proposed business system are the expenses arising from developing, installing, training and implementing the system. We started the project by listing the possible queries that the user might want to satisfy and on these lines we guided the project further. Following are the drawbacks which our project overcomes: Firstly, there are expenses in maintaining the human resource and more staff is required in maintaining the data. Secondly, the time involved in recording the data is also more. Thirdly, if the project is to be used for future references then the whole records have to be searched to find out one single record, which is very time consuming. The cost of storing the data and retrieval of data is less. No doubt initially the cost of installing the hardware and providing training to the user staff will be high but in long run benefits are more than the costs; thus our project is ECONOMICAL FEASIBLE.
Page | 22

SYSTEM ANALYSIS
It is the detailed understanding of all important facts of the business area under investigation. The relationships of various system components among themselves and with environment are studied and understood. This requires data collection from a variety of sources like questionnaires, forms, interviews, records etc. Structured analysis is a set of techniques and graphical tools that allow the analysis to develop a new kind of system specifications that are easily understandable to the user. The structured analysis considers new goals and structured tools for analysis. The new goals specify the following: Use of graphics wherever possible to help better communication.

To differentiate between logical and physical system.

Page | 23

WORKING ENVIRONMENT

The project Courier Services Management System has been made in Java and Oracle 9i. The server used in this project is BEA Weblogic Platform 8.1 JAVA Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991. It took 18 months to develop the first working version. This language was initially called Oak but was renamed Java in 1995. IMPORTANCE OF JAVA Java Applications and Applets Java can be used to create two types of programs: applications and applets. An application is a program that runs on your computer, under the operating system of that computer. That is, an application created by Java is more or less like one created using C or C++. When used to create applications, Java is not much different from any other
Page | 24

computer language. Rather, it is Javas ability to create applets that makes it important. An applet is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser. An applet is actually a tiny Java program, dynamically downloaded across the network, just like an image, sound file, or video clip. The important difference is that an applet is an intelligent program, not just an animation or media file. In other words, an applet is a program that can react to user input and dynamically changenot just run the same animation or sound over and over. Security When you use a Java-compatible Web browser, you can safely download Java applets without fear of viral infection or malicious intent. Java achieves this protection by confining a Java program to the Java execution environment and not allowing it access to other parts of the computer. Portability Many types of computers and operating systems are in use throughout the worldand many are connected to the Internet. For programs to be dynamically downloaded to all the various types of platforms connected to the Internet, some means of generating portable executable code is needed. Java provides portability.

Page | 25

Bytecode Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called the Java Virtual Machine (JVM). That is, in its standard form, the JVM is an interpreter for bytecode

FEATURES OF JAVA
Simple Secure Portable Object-oriented Robust Multithreaded Architecture-neutral Interpreted High performance Distributed Dynamic

PACKAGES
Packages are containers for classes that are used to keep the class name space compartmentalized.
Page | 26

This is the general form of the package statement: package pkg;

SERVLETS
Servlets are small programs that execute on the server side of a Web connection. Just as applets dynamically extend the functionality of a Web browser, servlets dynamically extend the functionality of a Web server.

The Life Cycle of a Servlet


Three methods are central to the life cycle of a servlet. These are init( ), service( ), and destroy( ). They are implemented by every servlet and are invoked at specific times by the server. The basic steps are the following: 1. Create and compile the servlet source code. 2. Start Weblogic. 3. Start a Web browser and request the servlet.

The javax.servlet Package


Page | 27

The javax.servlet package contains a number of interfaces and classes that establish the framework in which servlets operate. The following table summarizes the core interfaces that are provided in this package. The most significant of these is Servlet. All servlets must implement this interface or extend a class that implements the interface. The ServletRequest and ServletResponse interfaces are also very important. Interface Description Servlet Declares life cycle methods for a servlet. ServletConfig Allows servlets to get initialization parameters. ServletContext Enables servlets to log events and access information about their environment. ServletRequest Used to read data from a client request. ServletResponse Used to write data to a client response. SingleThreadModel Indicates that the servlet is thread safe.

Page | 28

The WebLogic Server


Today's business environment demands Web and ecommerce applications that accelerate our entry into new markets, help us find new ways to reach and retain customers, and allow us to introduce new products and services quickly. To build and deploy these new solutions, we need a proven, reliable e-commerce platform that can connect and empower all types of users while integrating our corporate data, mainframe applications, and other enterprise applications in a powerful, flexible, end-to-end e-commerce solution. Our solution must provide the performance, scalability, and high availability needed to handle your most critical enterprise-scale computing. As the industry-leading e-commerce transaction platform, WebLogic Server allows us to quickly develop and deploy reliable, secure, scalable and manageable applications. It manages system-level details so we can concentrate on business logic and presentation. WebLogic Server is an application server: a platform for developing and deploying multitier distributed enterprise
Page | 29

applications. WebLogic Server centralizes application services such as Web server functionality, business components, and access to backend enterprise systems. It uses technologies such as caching and connection pooling to improve resource use and application performance. WebLogic Server also provides enterprise-level security and powerful administration facilities. WebLogic Server operates in the middle tier of a multitier (or n-tier) architecture. A multitier architecture determines where the software components that make up a computing system are executed in relation to each other and to the hardware, network, and users. Choosing the best location for each software component lets us develop applications faster; eases deployment and administration; and provides greater control over performance, utilization, security, scalability, and reliability. WebLogic Server implements J2EE, the Java Enterprise standard. Java is a network-savvy, object-oriented programming language, and J2EE includes component technologies for developing distributed objects. This functionality adds a second dimension to the WebLogic Server application architecturea layering of application logic, with each layer selectively deployed among WebLogic Server J2EE technologies.

J2EE Platform
Page | 30

WebLogic Server contains Java 2 Platform, Enterprise Edition (J2EE) technologies. J2EE is the standard platform for developing multitier enterprise applications based on the Java programming language. The technologies that make up J2EE were developed collaboratively by Sun Microsystems and other software vendors, including BEA Systems. J2EE applications are based on standardized, modular components. WebLogic Server provides a complete set of services for those components and handles many details of application behavior automatically, without requiring programming.

FEATURES OF WEBLOGIC 8.1


WebLogic Server provides essential features for developing and deploying mission-critical e-commerce applications across distributed, heterogeneous computing environments. These features include the following:

Standards leadershipComprehensive Enterprise Java support to ease implementation and deployment of application components. WebLogic Server is the first independently developed Java application server to achieve J2EE certification. Rich client optionsWebLogic Server supports Web browsers and other clients that use HTTP; Java clients that use RMI (Remote Method Invocation) or IIOP (Internet Inter-ORB Protocol); and mobile devices that use (WAP) Wireless Access Protocol. Connectors
Page | 31

from BEA and other companies enable virtually any client or legacy application to work with a WebLogic Server application. Flexible Web servicesWebLogic Server provides a solid platform for deploying Web services as components of a heterogeneous distributed application. Web services use a cross-platform, crosslanguage data model (XML) to provide interoperability among application components on diverse hardware and software platforms.

Enterprise e-business scalabilityEfficient use and high availability of critical resources are achieved through Enterprise JavaBean business components and mechanisms such as WebLogic Server clustering for dynamic Web pages, backend resource pooling, and connection sharing. Robust administrationWebLogic Server offers a Web-based Administration Console for configuring and monitoring WebLogic Server services. A command-line interface for configuration makes it convenient to administer WebLogic Servers with scripts. E-commerce-ready securityWebLogic Server provides Secure Sockets Layer (SSL) support for encrypting data transmitted across WebLogic Server, clients, and other servers. WebLogic security realms feature user authentication and authorization for all WebLogic Server services. External security stores,
Page | 32

such as Lightweight Directory Access Protocol (LDAP) servers, can be adapted to WebLogic realms, enabling single sign-on for the enterprise. The Security Service Provider Interface makes it possible to extend WebLogic Security services and to implement WebLogic Security features in applications. Maximum development and deployment flexibility WebLogic Server provides tight integration with and support for leading databases, development tools, and other environments.

The next two sections describe these two views of WebLogic Server architecture: software tiers and application logic layers. Software Component Tiers The software components of a multitier architecture consist of three tiers:

The client tier contains programs executed by users, including Web browsers and network-capable application programs. These programs can be written in virtually any programming language.

The middle tier contains WebLogic Server and other servers that are addressed directly by clients, such as existing Web servers or proxy servers.
Page | 33

The backend tier contains enterprise resources, such as database systems, mainframe and legacy applications, and packaged enterprise resource planning (ERP) applications.

Client applications access WebLogic Server directly, or through another Web server or proxy server. WebLogic Server generally connects with backend services on behalf of clients. However, clients may directly access backend services using a multitier JDBC driver. Client-Tier Components WebLogic Server clients use standard interfaces to access WebLogic Server services. WebLogic Server has complete Web server functionality, so a Web browser can request pages from WebLogic Server using the Web's standard HTTP protocol. WebLogic Server servlets and JavaServer Pages (JSPs) produce the dynamic, personalized Web pages required for advanced ecommerce Web applications. Client programs written in Java may include highly interactive graphical user interfaces built with Java Swing classes. They can also access WebLogic Server services using standard J2EE APIs.

Page | 34

All these services are also available to Web browser clients by deploying servlets and JSP pages in WebLogic Server.

Middle-Tier Components The middle tier includes WebLogic Server and other Web servers, firewalls, and proxy servers that mediate traffic between clients and WebLogic Server. The Nokia WAP server, part of the BEA mobile commerce solution, is an example of another middle tier server that provides connectivity between wireless devices and WebLogic Server. Applications based on a multitier architecture require reliability, scalability, and high performance in the middle tier. The application server you select for the middle tier is, therefore, critical to the success of your system. The WebLogic Server cluster option allows you to distribute client requests and back-end services among multiple cooperating WebLogic Servers. Programs in the client tier access the cluster as if it were a single WebLogic Server. As the workload increases, you can add WebLogic Servers to the cluster to share the work. The cluster uses a selectable load-balancing algorithm to choose a WebLogic Server in the cluster that is capable of handling the request.
Page | 35

When a request fails, another WebLogic Server that provides the requested service can take over. Failover is transparent whenever possible, which minimizes the amount of code that must be written to recover from failures. For example, servlet session state can be replicated on a secondary WebLogic Server so that if the WebLogic Server that is handling a request fails, the client's session can resume uninterrupted on the secondary server. WebLogic EJB, JMS, JDBC, and RMI services are all implemented with clustering capabilities. Backend-Tier Components The backend tier contains services that are accessible to clients only through WebLogic Server. Applications in the backend tier tend to be the most valuable and mission-critical enterprise resources. WebLogic Server protects them by restricting direct access by end users. With technologies such as connection pools and caching, WebLogic Server uses back-end resources efficiently and improves application response. Backend services include databases, enterprise resource planning (ERP) systems, mainframe applications, legacy enterprise applications, and transaction monitors. Existing enterprise applications can be integrated into the backend tier using the Java Connector Architecture (JCA) specification from Sun Microsystems. WebLogic Server makes it easy to add a Web interface to an integrated backend application.

Page | 36

A database management system is the most common backend service, required by nearly all WebLogic Server applications. WebLogic EJB and WebLogic JMS typically store persistent data in a database in the backend tier. A JDBC connection pool, defined in WebLogic Server, opens a predefined number of database connections. Once opened, database connections are shared by all WebLogic Server applications that need database access. The expensive overhead associated with establishing a connection is incurred only once for each connection in the pool, instead of once per client request. WebLogic Server monitors database connections, refreshing them as needed and ensuring reliable database services for applications. WebLogic Enterprise Connectivity, which provides access to BEA WebLogic EnterpriseTM systems, and Jolt for WebLogic Server, which provides access to BEA Tuxedo systems, also use connection pools to enhance system performance. Application Logic Layers WebLogic Server implements J2EE component technologies and services. J2EE component technologies include servlets, JSP Pages, and Enterprise JavaBeans. J2EE services include access to standard network protocols, database systems, and messaging systems. To build a WebLogic Server application, you must create
Page | 37

and assemble components, using the service APIs when necessary. Components are executed in the WebLogic Server Web container or EJB container. Containers provide the life cycle support and services defined by the J2EE specifications so that the components you build do not have to handle underlying details.

JDBC
Java Database Connectivity (JDBC) provides access to backend database resources. Java applications access JDBC using a JDBC driver, which is a database vendorspecific interface for a database server. Although any Java application can load a vendor's JDBC driver, connect to the database, and perform database operations, WebLogic Server provides a significant performance advantage by offering JDBC connection pools. A JDBC connection pool is a named group of JDBC connections managed through WebLogic Server. At startup time WebLogic Server opens JDBC connections and adds them to the pool. When an application requires a JDBC connection, it gets a connection from the pool, uses it, and then returns it to the pool for use by for other applications. Establishing a database connection is often a time-consuming, resource-intensive operation, so a connection pool, which limits the number of connection operations, improves performance. WebLogic Server also provides JDBC multipools for achieving load balancing or high availability capabilities
Page | 38

with database connections in single-server configurations. Multipools are a "pool of pools" that provide a configurable algorithm for choosing which pool to provide a connection for a given request. Currently, WebLogic Server provides algorithms to support either high availability or load balancing behavior for database connections. To register a connection pool in the JNDI naming tree, define a DataSource object for it. Java client applications can then get a connection from the pool by performing a JNDI lookup on the DataSource name. Server-side Java classes use the WebLogic JDBC pool driver, which is a generic JDBC driver that calls through to the vendor-specific JDBC driver. This mechanism makes application code more portable, even if you change the brand of database used in the backend tier. The client-side JDBC driver is the WebLogic JDBC/RMI driver, which is an RMI interface to the pool driver. Use this driver the same way you use any standard JDBC driver. When the JDBC/RMI driver is used, Java programs can access JDBC in a manner consistent with other WebLogic Server distributed objects, and they can keep database data structures in the middle tier.

Page | 39

ORACLE
The concept of a relational database is not new. It was originally developed back in 1970 by Dr. E.F. Codd. He laid down the theory of relational databases in his seminal paper entitled A Relational Model of Data for Large Shared Data Banks published in Communications of the ACM (Association for Computing Machinery), Vol. 13, No. 6, June 1970. The basic concepts of a relational database are fairly easy to understand. A relational database is a collection of related information that has been organized into structures known as tables. Each table contains rows that are further organized into columns. These tables are stored in the database in structures known as schemas, which are areas where database users may store their tables. Each user may
Page | 40

also choose to grant permissions to other users to access their tables. For a database accessed using a computer, the database management system is the software that manages the files stored in the file system of the computer. The Oracle database is one such piece of software; other examples include SQL Server, DB2, and MySQL. Of course, every database must have some way to get data in and out of it, preferably using a common language understood by all databases. Todays database management systems implement a standard language known as Structured Query Language, or SQL. Among other things, SQL allows you to retrieve, add, update, and delete information in a database

Structured Query Language (SQL)


Structured Query Language (SQL) is the standard language designed to access relational databases. SQL is pronounced either as the word sequel or as the letters S-Q-L. (I prefer sequel as its quicker to say.) SQL is based on the groundbreaking work of Dr. E.F. Codd, with the first implementation of SQL being developed by IBM in the mid-1970s. IBM was conducting a research project known as System R, and SQL was born from that project. Later in 1979, a company then known as Relational Software Inc. (known today as Oracle Corporation) released the first commercial version of SQL. SQL is now fully standardized and recognized by the
Page | 41

American National Standards Institute (ANSI). You can use SQL to access an Oracle, SQL Server, DB2, or MySQL database. SQL uses a simple syntax that is easy to learn and use. Youll see some simple examples of its use in this chapter. There are five types of SQL statements, outlined in the following list:

Query statements Allow you to retrieve rows stored in database tables. You write a query using the SQL SELECT statement.

Data Manipulation Language (DML) statements Allow you to modify the contents of tables. There are three DML statements: o INSERT Allows you to add rows to a table. o UPDATE Allows you to change a row. o DELETE Allows you to remove rows.
o

Data Definition Language (DDL) statements Allow you to define the data structures, such as tables, that make up a database. There are five basic types of DDL statements:

Page | 42

CREATE Allows you to create a database structure. For example, CREATE TABLE is used to create a table; another example is CREATE USER, which is used to create a database user. ALTER Allows you to modify a database structure. For example, ALTER TABLE is used to modify a table. DROP Allows you to remove a database structure. For example, DROP TABLE is used to remove a table. RENAME Allows you to change the name of a table. TRUNCATE Allows you to delete the entire contents of a table.

Transaction Control (TC) statements Allow you to permanently record the changes made to the rows stored in a table or undo those changes. There are three TC statements:

COMMIT Allows you to permanently record changes made to rows. ROLLBACK Allows you to undo changes made to rows. SAVEPOINT Allows you to set a savepoint to which you can roll back changes made to rows.
Page | 43

Data Control Language (DCL) statements Allow you to change the permissions on database structures. There are two DCL statements:

GRANT Allows you to give another user access to your database structures, such as tables. REVOKE Allows you to prevent another user from accessing to your database structures, such as tables.

Page | 44

DATABASE DESIGN
1. cust
account_no number(20), type varchar(20), user_name varchar(25), password varchar(20), create_date varchar(20), phone number(15), mobile number(15), email varchar(30), address varchar(40), plan_name varchar(30)

2. Package
package_id number(10),name varchar(20), connection varchar(20), description varchar(500), validity varchar(20), available_service varchar(20) charge number(10) free number(10)
Page | 45

3. Usageinfo
account_no number(20), start_time varchar(20), end_time varchar(20), upload number(10), download number(10)

4. Bill
account_no number(20), area varchar(20), delivery_mode varchar(20), bill_date varchar(20), bill_no number(10), amount number(20), status varchar(20), problem varchar(20)

Page | 46

FORM DESIGN
This is the login page which will be displayed to everyone including the administrator and employee. Whenever a customer, employee or administrator fills up the details like username and password then the corresponding page displays up.

Page | 47

HOME PAGE FOR CUSTOMER


When the customer signs in this page is displayed up showing the customer information. On clicking the Customer Information on the menu bar, again this page is displayed up where the customer can see his details like username, account no., phone no., address, plan etc.

Page | 48

On clicking the Billing Information tab on the menu bar, this page is displayed up where the customer can see his bill details like last bill amount, status of the bill, bill date etc.

Page | 49

If the user wants to change his password then on clicking Account Mgt tab, a customer can see this page where he has to type his current password and in the new password textbox he has to type the password with which he wants to replace his current password.

On other page we get this type of output

Page | 50

On clicking the Contact us on the menu bar, this page is displayed up where the customer can see his details of the staff whom they have to contact in case they have problem in their account or some detail has to be changed in the records.

Page | 51

This is the page for Usage Information where customer will be able to see how much internet usage he has done. The start date and time along with end date and time is displayed. The amount of MBs used in uploading the web pages and those used for downloading are also displayed.

Page | 52

Clicking Balance Information tells you how much MBs you have used and how much free MBs the customer gets every month if it is in its package. The amount of MBs left in case he gets some free MBs is displayed.

Page | 53

Package Information tells the various packages available in MTNL so that customer can have the ease to see the various options provided to him.

Page | 54

HOME PAGE FOR EMPLOYEE An employee after signing in will see this page. He will have the options to add new records of customers, delete existing records or do some updations in the customers records. Apart from this the details of employee is displayed on the page.

Page | 55

This page is displayed whenever employee clicks on ADD tab. Various information regarding the customer like name, address, contact details etc. have to be filled and then click on the corresponding button.

Page | 56

On next page, we are shown whether the record is inserted or not.

This page is displayed whenever employee clicks on DELETE tab. Customers Account number whose record has to be deleted should be entered and then click on the corresponding button.

Page | 57

On the next page, we get the details of that account no. of the customer

Page | 58

After that if the record is deleted then it is visible on next page

This page is displayed whenever employee clicks on UPDATE tab. Customers Account number whose record has to be updated should be entered and then click on the corresponding button. His information is displayed on the next page. Updations are done and the button is clicked.

Page | 59

On the next page, we get the details of that account no. of the customer

Page | 60

After that if the record is updated then it is visible on next page

If the employee wants to view the details of customers belonging to a particular area then he clicks on the AREAWISE tab under View Customer. Employee has to enter the area name and click on the button.

Page | 61

On next page, customers having that area will be displayed

If the employee wants to view the details of customers belonging to a particular package/plan then he clicks on the PLANWISE tab under View Customer. Employee has to enter the plan name and click on the button.

Page | 62

On next page,

If the employee wants to view the details of customers belonging to a particular bill no. then he clicks on the bill no. tab under View Bill. Employee has to enter the bill no. and click on the button.

Page | 63

On next page, customer having that bill no. will be displayed

If the employee wants to view the details of customers belonging to a particular payment mode then he clicks on the Delivery mode tab under View Bill. Employee has to enter the mode like cash or cheque and click on the button.

Page | 64

On next page, customer having that details of customers will be displayed

If the employee wants to view the details of customers belonging to a particular group of bill amount then he clicks on the Amountwise tab under View Bill. Employee has to click on the corresponding button for which he has to see the details of the customers.

Page | 65

On next page, customer details will be displayed

If the employee wants to view the details of customers whose last bill is disputed or undisputed then he clicks on the Status tab under View Bill. Employee has to enter the corresponding text whether bill is disputed or undisputed and click on the button.

Page | 66

On next page, customer details will be displayed

HOME PAGE FOR ADMINISTRATOR This page displays up when administrator signs in. His details are shown on this page. He has the option to add, delete or update records of employees apart from having all the privileges which a employee gets like adding, deleting, updating records of customers and other view options.
Page | 67

This page is displayed whenever the administrator clicks on ADD and then on employee tab. Various information regarding the employee like name, address, contact details etc. have to be filled and then click on the corresponding button.

Page | 68

On the next page, we get the result whether the record is inserted or not.

This page is displayed whenever administrator clicks on DELETE and then on Employee tab. Employees Account number whose record has to be deleted should be entered and then click on the corresponding button.
Page | 69

On the next page, we get the details of that account no. of the employee

Page | 70

After that if the record is deleted then it is visible on next page

This page is displayed whenever Administrator clicks on UPDATE and then on Employee tab. Employees Account number whose record has to be updated should be entered and then click on the corresponding button. His information is displayed on the next page. Updations are done and the button is clicked.
Page | 71

On the next page, we get the details of that account no. of the employee
Page | 72

After that if the record is updated then it is visible on next page

This page is displayed whenever Administrator clicks on VIEW EMPLOYEE. Details of all the employees can be seen here.

Page | 73

CODING
LOGIN PAGE
Page | 74

(JSP PAGE)
<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*," %> <html> <script> <body> <title>Welcome to Mahanagar Telephone Nigam Limited</title> </script> <table border="10" width="1000" > <tr> <td colspan="100" bgColor="BLUE"> <h1><font color="GREEN"><center>Welcome to MTNL Broadband Services</center></font></h1> </td> </tr> <td colspan="20" height="500" bgColor=FFCCFF><center> <table border="2"> <tr> <td colspan="80" height="90"> <form name="form 1" action="/mtnl/pass" method="post" > USER NAME<input type="text" name ="c1"> <br> PASSWORD:<input type="password" name="c2"> <br><br><center><input type="submit" value="login"></center> </center></td></tr> </form> </table> <center> <br> <br> <b> Customers are advised to change the password from security perspective. For Triband the password should be changed at two places in a specific order. For detailed procedure refer Triband User's Guide. You may also dial 1504 and obtain online help. <br> <br> In Case of difficulties or suggestions please contact: MTNL Delhi Office, Ph. : 22221504/1504 OR <i> Email: helpdesk.delhi@bol.net.in</i> <br><br> <i> Copyright (c) 2004, Mahanagar Telephone Nigam Limited. All Rights Reserved </i> <br> Page | 75

<br> </b> Best Viewed with Internet Explorer 5.5 or above and Netscape(4.7 & 7.1 versions) in 1024 X 800 resolution </center> </td> </tr> </table> </body> </html>

SERVLET FILE FOR LOGIN PAGE


package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class log extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; String us,pd,tp; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); us=rq.getParameter("c1"); pd=rq.getParameter("c2"); ResultSet rst=st.executeQuery("select * from cust where (user_name='"+us+"' and password='"+pd+"')"); Page | 76

if(rst.next()) { int a=rst.getInt(1); String type=(rst.getString(2)).trim(); System.out.println(type); System.out.println(type.equals("admin")); if(type.equals("admin")) rs.sendRedirect("admin.jsp?ii="+a); else if(type.equals("emp")) rs.sendRedirect("emp.jsp?jj="+a); else rs.sendRedirect("one.jsp?kk="+a); } else pw.println("Record doesnot exist"); } catch(Exception e) { System.out.println("OUT"); } } }

USAGEWISE INFORMATION
<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*, java.awt.*, java.awt.event.*, java.applet.*" %> <html> <body bgColor="cc99ff"> <title> MTNL BROADBAND</title> <table border="0"> <tr> <td colspan="20"> <% PrintWriter pk=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int cc=Integer.parseInt(request.getParameter("ui")); System.out.println(cc); Page | 77

pk.println("<a href='one.jsp?kk="+cc+"'>Home</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </td> <td colspan="20"> <% PrintWriter pc=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int c=Integer.parseInt(request.getParameter("ui")); System.out.println(c); pc.println("<a href='one.jsp?kk="+c+"'>Cust info</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </td> <td colspan="20"> <% Page | 78

PrintWriter pb=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement();

int pp=Integer.parseInt(request.getParameter("ui")); System.out.println(pp); pb.println("<a href='bill.jsp?tt="+pp+"'>Billing Info</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </td> <td colspan="25"> <a href="">Account Mgt</a> </td> <td colspan="25"> <a href="package.jsp">Package Info</a> </td> <td colspan="22"> <a href="">Contact us </a> </td> <td colspan="20"> <a href="">Logout</a> Page | 79

</td> <td colspan="22"> <% PrintWriter pbb=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int ppb=Integer.parseInt(request.getParameter("ui")); System.out.println(ppb); pbb.println("<a href='balance.jsp?bb="+ppb+"'>Balance Info</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </td> <td colspan="20"> <% PrintWriter pu=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int p=Integer.parseInt(request.getParameter("ui")); Page | 80

System.out.println(p); pu.println("<a href='usage.jsp?ui="+p+"'>usage Info</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </td> </tr> </table> <br><br><br><br><br><br> <center> <h3><font Color="RED">Usage Information</font></h3> <br> <table border="3"> <% PrintWriter pw=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int typ=Integer.parseInt(request.getParameter("ui")); ResultSet rst; rst=st.executeQuery("select * from usageinfo where account_no="+typ); pw.println("<tr><td>"+"Account no"+"</td><td>"+"start time"+"</td><td>"+"end time"+"</td><td>"+"upload"+"</td><td>"+"download"+"</td></tr>"); while(rst.next()) { int a=rst.getInt(1); String start=rst.getString(2); String end=rst.getString(3); String up=rst.getString(4); String down=rst.getString(5); Page | 81

pw.println("<tr><td>"+a+"</td><td>"+start+"</td><td>"+end+"</td><td>"+up+"</td><td>"+down+"</td></t r>"); } con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </table> </body> </html>

ACCOUNT MANAGEMENT
package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class account extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; int oldp,newp,r=0; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); oldp=Integer.parseInt(rq.getParameter("t1")); ResultSet rst=st.executeQuery("select password from cust where password="+oldp); newp=Integer.parseInt(rq.getParameter("t2")); Page | 82

if(rst.next()) { r=st.executeUpdate("update cust set password="+newp+"where password="+oldp); System.out.println(r); } if(r!=0) pw.println("password updated"); else pw.println("mismatch password"); } catch(Exception e) { System.out.println(e); } } }

Package Information
<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*, java.awt.*, java.awt.event.*, java.applet.*" %> <html> <body bgColor="cc99ff"> <title> MTNL BROADBAND</title> <br><br><br><br><br><br> <center> <h3><font Color="RED">Package Information</font></h3> <br> <table border="3"> <% PrintWriter pw=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); ResultSet rst; pw.println("<tr><td>"+"packageid"+"</td><td>"+"name"+"</td><td>"+"connection"+"</td><td>"+ "description"+"</td><td>"+"Validity"+"</td><td>"+"Service"+"</td></tr>"); rst=st.executeQuery("select * from package"); Page | 83

while(rst.next()) { int a=rst.getInt(1); String name=rst.getString(2); String conn=rst.getString(3); String desc=rst.getString(4); String val=rst.getString(5); String service=rst.getString(6); pw.println("<tr><td>"+a+"</td><td>"+name+"</td><td>"+conn+"</td><td>" +desc+"</td><td>"+val+"</td><td>"+service+"</td></tr>"); } } catch(Exception e) { System.out.println("Error in connection"); } %> </table> </body> </html>

BALANCE INFORMATION
<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*, java.awt.*, java.awt.event.*, java.applet.*" %> <html> <body bgColor="cc99ff"> <title> MTNL BROADBAND</title> Page | 84

<br><br><br><br><br><br> <center> <h3><font Color="RED">Balance Information</font></h3> <br> <table border="3"> <% PrintWriter pw=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); ResultSet rst; int typ=Integer.parseInt(request.getParameter("bb")); pw.println("<tr><td>"+"Total balance"+"</td><td>"+"used balance"+"</td><td>"+"Remaining balance"+"</td></tr>"); rst=st.executeQuery("select * from usageinfo where account_no="+typ); int used=0; int total=500;

while(rst.next()) { int a=rst.getInt(1); String start=rst.getString(2); String end=rst.getString(3); int up=Integer.parseInt(rst.getString(4)); int down=Integer.parseInt(rst.getString(5)); used=used+up+down; } pw.println("<tr><td>"+total+"</td><td>"+used+"</td><td>"+(total-used)+"</td></tr>"); } catch(Exception e) Page | 85

{ System.out.println("Error in connection"); } %> </table> </body> </html>

BILLING INFORMATION
<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*, java.awt.*, java.awt.event.*, java.applet.*" %> <html> <body bgColor="cc99ff"> <title> MTNL BROADBAND</title> <table border="0"> <tr> <td colspan="20"> <% PrintWriter pk=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int cc=Integer.parseInt(request.getParameter("tt")); System.out.println(cc); pk.println("<a href='one.jsp?kk="+cc+"'>Home</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> Page | 86

</td> <td colspan="20"> <% PrintWriter pc=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int c=Integer.parseInt(request.getParameter("tt")); System.out.println(c); pc.println("<a href='one.jsp?kk="+c+"'>Cust info</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </td> <td colspan="20"> <% PrintWriter pb=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int pp=Integer.parseInt(request.getParameter("tt")); System.out.println(pp); pb.println("<a href='bill.jsp?tt="+pp+"'>Billing Info</a>"); con.close(); Page | 87

} catch(Exception e) { System.out.println("Error in connection"); } %> </td> <td colspan="25"> <a href="account.html">Account Mgt</a> </td> <td colspan="25"> <a href="package.jsp">Package Info</a> </td> <td colspan="22"> <a href="">Contact us </a> </td> <td colspan="20"> <a href="">Logout</a> </td> <td colspan="22"> <a href="balance.jsp">Balance Info</a> </td> <td colspan="20"> <% PrintWriter pu=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int p=Integer.parseInt(request.getParameter("tt")); System.out.println(p); Page | 88

pu.println("<a href='usage.jsp?ui="+p+"'>usage Info</a>"); con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </td> </tr> </table> <br><br><br><br><br><br> <center> <h3><font Color="RED">Billing Information</font></h3> <br> <table border="3"> <% PrintWriter pw=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int typ=Integer.parseInt(request.getParameter("tt")); ResultSet rst; rst=st.executeQuery("select * from bill where account_no="+typ); while(rst.next()) { int a=rst.getInt(1); String area=rst.getString(2); String deli=rst.getString(3); String date=rst.getString(4); String bill=rst.getString(5); Page | 89

String amt=rst.getString(6); String status=rst.getString(7); String prob=rst.getString(8); pw.println("<tr><td>Account no</td><td>"+a+"</td></tr><tr><td>Area</td><td>"+area+"</td></tr><tr> <td>Delivery mode</td><td>"+deli+"</td></tr><tr><td>Bill Date</td><td>"+date+"</td></tr><tr><td>Bill no</td><td>"+bill+"</td></tr><tr><td>Amount</td><td>"+amt+"</td></tr> <tr><td>Status</td><td>"+status+"</td><tr><tr><td>Problem</td><td>"+prob+"</td></tr>"); } con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </table> </body> </html>

INSERTION
package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class add extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException, ServletException { PrintWriter pw=rs.getWriter(); Connection con; String str,type,name,pass,date,email,address,plan; Page | 90

int acc; long p,mob; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); acc=Integer.parseInt(rq.getParameter("tex1")); type=rq.getParameter("tex2"); name=rq.getParameter("tex3"); pass=rq.getParameter("tex4"); date=rq.getParameter("tex5"); p=Long.parseLong(rq.getParameter("tex6")); mob=Long.parseLong(rq.getParameter("tex7")); email=rq.getParameter("tex8"); address=rq.getParameter("tex9"); plan=rq.getParameter("tex10"); str="insert into cust values("+acc+",'"+type+"','"+name+"','"+pass+"','"+date+"',"+p+","+ mob+",'"+email+"','" +address+"','"+plan+"')"; int rst=st.executeUpdate(str); System.out.println(rst); if(rst>=1) pw.println("Record Inserted"); else pw.println("Record is not Inserted"); } catch(Exception e) { System.out.println("OUT"); } } }

HOMEPAGE FOR ADMINISTRATOR


<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*, java.awt.*, java.awt.event.*, java.applet.*" %> <html> <body bgColor="cc99ff"> Page | 91

<title> MTNL BROADBAND</title> <center> <table border="0"> <tr> <td colspan="10"> <a href="" class="anchorclass" rel="Submen1">ADD</a> </td> <div id="submen1" class="anylinkcss"> <ul> <li><a href="custadd.html">CUST</a></li> <li><a href="custadd.html">EMPLOYEE</a></li> </ul> </div> </td> <td colspan="10"> <a href="" class="anchorclass" rel="Submen2">UPDATE</a> </td> <div id="submen2" class="anylinkcss"> <ul> <li><a href="custadd.html">CUST</a></li> <li><a href="custadd.html">EMPLOYEE</a></li> </ul> </div> </td> <td colspan="10"> <a href="" class="anchorclass" rel="Submen3">DELETE</a> </td> <div id="submen3" class="anylinkcss"> <ul> <li><a href="custadd.html">CUST</a></li> <li><a href="custadd.html">EMPLOYEE</a></li> </ul> </div> </td> <td> <a href="" class="anchorclass" rel="Submenu1">VIEW USER</a> </td> <div id="submenu1" class="anylinkcss"> <ul> <li><a href="area.html">AREAWISE</a></li> <li><a href="pli.html">PLANWISE</a></li> </ul> </div> <td> <a href="" class="anchorclass" rel="Submenu2">VIEW BILL</a> Page | 92

</td> <div id="submenu2" class="anylinkcss"> <ul> <li><a href="bill.html">BILL NO</a></li> <li><a href="del.html">DELIVERY MODE</a></li> <li><a href="amount.html">AMOUNT WISE</a></li> <li><a href="disp.html">DISPUTED/UNDISPUTED</a></li> </ul> </div> <td> <a href="" class="anchorclass" rel="Submenu3">VIEW EMPLOYEE</a> </td> <div id="submenu3" class="anylinkcss"> <ul> <li><a href="employee.jsp">DEPARTMENTWISE</a></li> </ul> </div> </tr> </table> <br><br><br><br><br><br> <center> <h3><font Color="RED">Admin Details</font></h3> <table border="3"> <% PrintWriter pw=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int typ=Integer.parseInt(request.getParameter("ii")); ResultSet rst; rst=st.executeQuery("select * from cust where account_no="+typ); while(rst.next()) { int a=rst.getInt(1); String user=rst.getString(3); String date=rst.getString(5); String phone=rst.getString(6); String mobile=rst.getString(7); String email=rst.getString(8); String address=rst.getString(9); String plan=rst.getString(10);

Page | 93

pw.println("<tr><td>Account no</td><td>"+a+"</td></tr><tr><td>user name</td><td>"+user+"</td></tr><tr><td>Creation Date</td><td>"+date+"</td></tr><tr><td>Phone</td><td>"+phone+"</td></tr><tr> <td>Mobile</td><td>"+mobile+"</td></tr><tr><td>Email</td><td>"+email+"</td> </tr><tr><td>Address</td><td>"+address+"</td><tr><tr><td>Plan</td><td>"+plan +"</td></tr>"); } con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </table> </body> </html>

AMOUNTWISE BILL VIEW


package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class amt extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); String ar=rq.getParameter("tt1"); String br=rq.getParameter("tt2"); String cr=rq.getParameter("tt3"); Page | 94

String dr=rq.getParameter("tt4"); ResultSet rst=null; if(ar!=null) rst=st.executeQuery("select account_no from bill where amount<='"+200+"'"); else if(br!=null) rst=st.executeQuery("select account_no from bill where (amount>='"+200+"' and amount <='"+500+"')"); else if(cr!=null) rst=st.executeQuery("select account_no from bill where (amount>='"+500+"' and amount<='"+1000+"')"); else if(dr!=null) rst=st.executeQuery("select account_no from bill where amount>='"+1000+"'"); pw.println("<html><body>"); pw.println("<table border='3'>"); while(rst.next()) { int accno=rst.getInt(1); ResultSet rest=st.executeQuery("select * from cust where account_no="+accno); if(rest.next()) { String type =rest.getString(2); String name=rest.getString(3); String pass=rest.getString(4); String date=rest.getString(5); long p =rest.getLong(6); long mob=rest.getLong(7); String emai=rest.getString(8); String addr=rest.getString(9); String plan=rest.getString(10); pw.println("<tr><td>"+accno+"</td><td>"+type+"</td><td>"+name+"</td><td>"+p ass+"</td><td>"+date+"</td><td>"+p+"</td><td>"+mob+"</td><td>"+emai+"</td> <td>"+addr+"</td><td>"+plan+"</td></tr>"); } } pw.println("</table></body></html>"); } catch(Exception e) { System.out.println("OUT"); } } Page | 95

AREAWISE CUSTOMERS
package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class are extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; String ar; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); ar=rq.getParameter("t1"); ResultSet rst=st.executeQuery("select account_no from bill where area='"+ar+"'"); pw.println("<html><body>"); pw.println("<table border='3'>"); while(rst.next()) { int accno=rst.getInt(1); ResultSet rest=st.executeQuery("select * from cust where account_no="+accno); if(rest.next()) { String type =rest.getString(2); String name=rest.getString(3); String pass=rest.getString(4); String date=rest.getString(5); long p =rest.getLong(6); long mob=rest.getLong(7); Page | 96

String emai=rest.getString(8); String addr=rest.getString(9); String plan=rest.getString(10); pw.println("<tr><td>"+accno+"</td><td>"+type+"</td><td>"+name+"</td><td>"+p ass+"</td><td>"+date+"</td><td>"+p+"</td><td>"+mob+"</td><td>"+emai+"</td> <td>"+addr+"</td><td>"+plan+"</td></tr>"); } } pw.println("</table></body></html>"); } catch(Exception e) { System.out.println("OUT"); } } }

BILL NO. WISE INFORMATION


package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*;

public class biln extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException, ServletException { PrintWriter pw=rs.getWriter(); Connection con; String br; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Page | 97

Statement st=con.createStatement(); br=rq.getParameter("tt1"); ResultSet rst=st.executeQuery("select account_no from bill where bill_no='"+br+"'"); pw.println("<html><body>"); pw.println("<table border='3'>"); while(rst.next()) { int accno=rst.getInt(1); ResultSet rest=st.executeQuery("select * from cust where account_no="+accno); if(rest.next()) { String type =rest.getString(2); String name=rest.getString(3); String pass=rest.getString(4); String date=rest.getString(5); long p =rest.getLong(6); long mob=rest.getLong(7); String emai=rest.getString(8); String addr=rest.getString(9); String plan=rest.getString(10); pw.println("<tr><td>"+accno+"</td><td>"+type+"</td><td>"+name+"</td ><td>"+pass+"</td><td>"+date+"</td><td>"+p+"</td><td>"+mob+"</td><td>"+emai+"</td><td>" +addr+"</td><td>"+plan+"</td></tr>"); } } pw.println("</table></body></html>"); } catch(Exception e) { System.out.println("OUT"); } } }

DELETION
Page | 98

package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class delete1 extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; int acc; String type,name,pass,date,emai,addr,plan; long p,mob; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); acc=Integer.parseInt(rq.getParameter("tex12")); ResultSet rst=st.executeQuery("select * from cust where account_no="+acc); if(rst.next()) { acc=rst.getInt(1); type=rst.getString(2); name=rst.getString(3); pass=rst.getString(4); date=rst.getString(5); p=rst.getLong(6); mob=rst.getLong(7); emai=rst.getString(8); addr=rst.getString(9); plan=rst.getString(10); pw.println("<html><body>"); pw.println("<form name='f8' action='/mtnl/del2' method='post'>"); pw.println("Account no<input type='text' name='tt1' value="+acc+">"); pw.println("Type<input type='text' name='tt2' value='"+type+"'>"); pw.println("User name<input type='text' name='tt3' value='"+name+"'>"); pw.println("Password<input type='text' name='tt4' value='"+pass+"'>"); pw.println("Date<input type='text' name='tt5' value='"+date+"'>"); Page | 99

pw.println("Phone<input type='text' name='tt6' value="+p+">"); pw.println("Mobile<input type='text' name='tt7' value="+mob+">"); pw.println("Email<input type='text' name='tt8' value='"+emai+"'>"); pw.println("Address<input type='text' name='tt9' value='"+addr+"'>"); pw.println("Plan name<input type='text' name='tt10' value='"+plan+"'>"); pw.println("<br><input type='submit' value='Delete data'>"); pw.println("</form></body></html>"); } else pw.println("Record not found"); } catch(Exception e) { System.out.println("OUT"); } } }

DISPLAY OF RECORD TO BE DELETED


package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class delete2 extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; String str; int acc; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); acc=Integer.parseInt(rq.getParameter("tt1")); Page | 100

str="delete cust where(account_no="+acc+")"; int rst=st.executeUpdate(str); System.out.println(rst); if(rst>=1) pw.println("Record deleted"); else pw.println("Record is not deleted"); } catch(Exception e) { System.out.println("OUT"); } } }

UPDATION
package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class update1 extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; int acc; String type,name,pass,date,email,address,plan; long p,mob; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); acc=Integer.parseInt(rq.getParameter("tex11")); ResultSet rst=st.executeQuery("select * from cust where account_no="+acc); if(rst.next()) { acc=rst.getInt(1); Page | 101

type=rst.getString(2); name=rst.getString(3); pass=rst.getString(4); date=rst.getString(5); p=rst.getLong(6); mob=rst.getLong(7); email=rst.getString(8); address=rst.getString(9); plan=rst.getString(10); pw.println("<html><body>"); pw.println("<form name='f8' action='/mtnl/up2' method='post'>"); pw.println("Account no<input type='text' name='tt1' value="+acc+">"); pw.println("Type<input type='text' name='tt2' value='"+type+"'>"); pw.println("User name<input type='text' name='tt3' value='"+name+"'>"); pw.println("Password<input type='text' name='tt4' value='"+pass+"'>"); pw.println("Date<input type='text' name='tt5' value='"+date+"'>"); pw.println("Phone<input type='text' name='tt6' value="+p+">"); pw.println("Mobile<input type='text' name='tt7' value="+mob+">"); pw.println("Email<input type='text' name='tt8' value='"+email+"'>"); pw.println("Address<input type='text' name='tt9' value='"+address+"'>"); pw.println("Plan name<input type='text' name='tt10' value='"+plan+"'>"); pw.println("<br><input type='submit' value='Update data'>"); pw.println("</form></body></html>"); } else pw.println("Record not found"); } catch(Exception e) { System.out.println("OUT"); } } }

DISPLAY OF RECORD TO BE UPDATED


package pack; Page | 102

import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class update2 extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException,ServletException { PrintWriter pw=rs.getWriter(); Connection con; String str,type,name,pass,date,emai,addr,plan; int acc; long p,mob; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); acc=Integer.parseInt(rq.getParameter("tt1")); type=rq.getParameter("tt2"); name=rq.getParameter("tt3"); pass=rq.getParameter("tt4"); date=rq.getParameter("tt5"); p=Long.parseLong(rq.getParameter("tt6")); mob=Long.parseLong(rq.getParameter("tt7")); emai=rq.getParameter("tt8"); addr=rq.getParameter("tt9"); plan=rq.getParameter("tt10"); str="update cust set account_no="+acc+",type='"+type+"',user_name='"+ name+"',password='"+pass+"',create_date='"+date+"',phone="+p+",mobile="+mob+",email='"+emai+ "',address='"+addr+"',plan_name='"+plan+"' where(account_no="+acc+")"; int rst=st.executeUpdate(str); System.out.println(rst); if(rst>=1) pw.println("Record Updated"); else pw.println("Record is not updated"); } catch(Exception e) {System.out.println("chunny"); Page | 103

System.out.println("OUT"); } } }

PAYMENT MODE WISE CUSTOMERS


package pack; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*;

public class delm extends HttpServlet { public void doPost(HttpServletRequest rq, HttpServletResponse rs)throws IOException, ServletException { PrintWriter pw=rs.getWriter(); Connection con; String dr; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); dr=rq.getParameter("tt1"); ResultSet rst=st.executeQuery("select account_no from bill where delivery_mode='"+dr+"'"); pw.println("<html><body>"); pw.println("<table border='3'>"); while(rst.next()) { int accno=rst.getInt(1); ResultSet rest=st.executeQuery("select * from cust where account_no="+accno);

Page | 104

while(rest.next()) { String type =rest.getString(2); String name=rest.getString(3); String pass=rest.getString(4); String date=rest.getString(5); long p =rest.getLong(6); long mob=rest.getLong(7); String emai=rest.getString(8); String addr=rest.getString(9); String plan=rest.getString(10); pw.println("<tr><td>"+accno+"</td><td>"+type+"</td><td>"+name+"</td> <td>"+pass+"</td><td>"+date+"</td><td>"+p+"</td><td>"+mob+"</td><td>"+emai+"</td><td>" +addr+"</td><td>"+plan+"</td></tr>"); } } pw.println("</table></body></html>"); } catch(Exception e) { System.out.println("OUT"); } } }

HOMEPAGE FOR EMPLOYEE


<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*, java.awt.*, java.awt.event.*, java.applet.*" %> <html> <body bgColor="cc99ff"> <title> MTNL BROADBAND</title> <center> <table border="0"> <tr> <td colspan="10"> <a href="custadd.html">ADD</a> </td> <td colspan="10"> <a href="custadd.html" >UPDATE</a> </td> <td colspan="10"> <a href="custadd.html">DELETE</a> Page | 105

</td> <td> <a href="" class="anchorclass" rel="Submenu1">VIEW USER</a> </td> <div id="submenu1" class="anylinkcss"> <ul> <li><a href="area.html">AREAWISE</a></li> <li><a href="pli.html">PLANWISE</a></li> </ul> </div> <td> <a href="" class="anchorclass" rel="Submenu2">VIEW BILL</a> </td> <div id="submenu2" class="anylinkcss"> <ul> <li><a href="bill.html">BILL NO</a></li> <li><a href="del.html">DELIVERY MODE</a></li> <li><a href="amount.html">AMOUNT WISE</a></li> <li><a href="disp.html">DISPUTED/UNDISPUTED</a></li> </ul> </div> </tr> </table> <br><br><br><br><br><br> <center> <h3><font Color="RED">Employee Details</font></h3> <table border="3"> <% PrintWriter pw=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Statement st=con.createStatement(); int typ=Integer.parseInt(request.getParameter("jj")); ResultSet rst; rst=st.executeQuery("select * from cust where account_no="+typ); while(rst.next()) { int a=rst.getInt(1); Page | 106

String user=rst.getString(3); String date=rst.getString(5); String phone=rst.getString(6); String mobile=rst.getString(7); String email=rst.getString(8); String address=rst.getString(9); String plan=rst.getString(10); pw.println("<tr><td>Account no</td><td>"+a+"</td></tr><tr><td>user name</td><td>"+user+"</td></tr><tr><td>Creation Date</td><td>"+date+"</td></tr><tr><td>Phone</td><td>"+phone+"</td> </tr><tr><td>Mobile</td><td>"+mobile+"</td></tr><tr><td>Email</td><td>"+email+"</td></tr> <tr><td>Address</td><td>"+address+"</td><tr><tr><td>Plan</td><td>"+plan+"</td></tr>"); } con.close(); } catch(Exception e) { System.out.println("Error in connection"); } %> </table> </body> </html>

EMPLOYEE INFORMATION
<%@page import="javax.servlet.*, javax.servlet.http.*, java.sql.*, java.awt.*, java.awt.event.*, java.applet.*" %> <html> <body bgColor="cc99ff"> <title> MTNL BROADBAND</title> <br><br><br><br><br><br> <center> <h3><font Color="RED">Employee Information</font></h3> <br> <table border="3"> <% PrintWriter pw=response.getWriter(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","tiger"); Page | 107

Statement st=con.createStatement(); ResultSet rst; pw.println("<tr><td>"+"Account no"+"</td><td>"+"Type"+"</td><td>"+"User name"+"</td><td>"+ "Password"+"</td><td>"+"Create Date"+"</td><td>"+"Phone"+"</td><td>"+ "Mobile"+"</td><td>"+"Email"+"</td><td>"+"Address"+"</td><td>"+"Plan name"+"</td></tr>"); rst=st.executeQuery("select * from cust where type='emp'"); while(rst.next()) { int a=rst.getInt(1); String type=rst.getString(2); String user=rst.getString(3); String pass=rst.getString(4); String date=rst.getString(5); long p=rst.getLong(6); long mob=rst.getLong(7); String email=rst.getString(8); String address=rst.getString(9); String plan=rst.getString(10); pw.println("<tr><td>"+a+"</td><td>"+type+"</td><td>"+user+"</td><td>" +pass+"</td><td>"+date+"</td><td>"+p+"</td><td>"+mob+"</td><td>"+email+"</td><td>"+ address+"</td><td>"+plan+"</td></tr>"); } } catch(Exception e) { System.out.println("Error in connection"); } %> </table> </body> </html>

TESTING
Page | 108

No program or system is ever perfect; communication between user and designer is not always complete or clear and time is usually short. The result is errors. The errors must be eliminated before the system is ready for user acceptance. The main objective of testing is to systematically uncover as many errors as possible. The most severe defect of a software is one which can cause the program to fail to meet its requirements (from a costumers point of view). A good test is one, which is not redundant, and it is neither too simple nor too complex. Software testing accounts for a largest percentage of technical effort in software process. Testing is a set of activities that can be planned in advance and conducted systematically. For this purpose template for software testing, i.e., a set of steps into which specific test case design techniques and testing methods can be placed should be defined for software process. Testing- the process of exercising software to verify that it satisfies specified requirements and to detect faults; the measurement of software quality. Where the actual behaviour of the system is different from the expected behaviour, a failure is considered to have occurred.

Page | 109

A failure is the result of a fault. A fault is an error in the programming or specification that may or may not result in a failure. A failure is the manifestation of fault.

The principal aim of testing is to detect faults so that they can be removed before the product is made available to customers. Faults in software are made for a variety of reasons, from misinterpreting the requirements through to simple typing mistakes. It is the role of software testing and quality assurance, to reduce those faults by identifying the failures.

Some of the testing are:

System Testing System Testing is often the term given to group all types of testing that are performed against the system as a whole. So generally everything except for unit and integration testing.

Unit Testing
Page | 110

The most micro scale of testing; to test particular functions or code modules. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. Not always easily done unless the application has a welldesigned architecture with tight code; may require developing test driver modules or test harnesses.

Usability Testing Testing - testing for user-friendliness. Clearly this is subjective, and will depend on the targeted end-user or customer. User interviews, surveys, video recording of user sessions, and other techniques can be used. Programmers and testers are usually not appropriate as usability testers.

Conformance Testing Verifying implementation conformance to industry standards. Producing tests for the behavior of an implementation to be sure it provides the portability, interoperability, and/or compatibility a standard defines.

Functional Testing
Page | 111

Functional Testing the process of testing a system to verify that it meets the functional requirements. Integration Testing - Component Also referred to as Integration Testing in the Small. The testing of joined components of a system to determine if they function correctly together. Components in this sense are modules or units of code within the same system. An example may be the integration of a shopping basket component with a web component. Component Integration Testing is likely to focus on the two components operating correctly as a single solution. User Aceptance Testing User Acceptance Testing is the final stage of validation; it usually occurs just prior to the final sign off and is generally performed by users, not technical staff. The is process of verifying that the system under test (SUT) meets the customers/users needs and focuses on building confidence in the system, using business related scenarios. When at all possible, the customer should perform, or be closely involved during, this stage of testing. The customer should use the product in a realistic way in an environment similar to the operation environment, carrying out realistic business processes.

MAINTENANCE
Page | 112

There are two goals of Maintenance in SDLC: Increase the ability of the software and avoidance of failures.

Better Adaptability of the Software SDLCs idea of maintenance is very beneficial not only to the developers but also for the software itself. With the use of available data, developers will learn something new. In this account, they will be able to apply this knowledge to the software.

Although any developer would not wish for a problem, it poses a great opportunity to learn more about the industry and release updates to combat problems once and for all. The end result of constant updates will be a better software that can adapt to the changing environment. When a business spends thousands of dollars on project development, they expect more from the software. Maintenance will ensure that the software will last for a very long time.

Avoidance of Failures Maintenance does not only ensure that the problem will be fixed but maintenance should
Page | 113

prevent the same event from happening again. Software will always have that learning property as long as they are handled well by the developers. Developers will often work on the problem and at the same time give updates on the system to prevent failures. It is essential for developers to release updates especially if the software is an important part of the business.

Page | 114

CONCLUSION

This project is designed to meet the requirements of a Telecom Company. It has been developed in Java and the database has been built in Oracle 9i with Weblogic as server, keeping in mind the specifications of the system.

For designing the system we have used simple servlet and jsp files.

Overall the project teaches us the essential skills like:

1. 2.

Using system analysis and design techniques. Understanding programming logic in Html coding.

Page | 115

FUTURE PROSPECTS
This project can be enhanced by giving SMS and email facilities to customers whenever his bill is ready.

Page | 116

BIBLIOGRAPHY

1.

Java 2 Complete Reference (Herbert Schildt) Oracle Database 9i (Jason Price)

3.

Page | 117

You might also like