Student Report

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 43

TRAINING REPORT

OF SIX MONTHS INDUSTRIAL TRAINING, UNDERTAKEN AT

SLR INFOTECH PVT. LTD.


ON STUDENT MANAGEMENT SYSTEM SUBMITTED IN PARTIAL FULFILLMENT OF THE DEGREE OF BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE & ENGINEERING

Under the Guidance of: Name: Mr. Vivek Sood Designation: Project Incharge Department: Computer Science

Submitted By: Name:Sachin Gupta College Roll No.: 139/04 University Roll No.: 41303041

CHANDIGARH-PATIALA NATIONAL HIGHWAY, VILL. JHANSLA, TEHSIL RAJPURA, DISTT. PATIALA 140401

ACKNOWLEDGEMENT

At the very outset, I am highly indebted to SLR Infotech Pvt. Ltd. ,Chandigarh for giving me an opportunity to carry out my project on STUDENT MANAGEMENT SYSTEM at their esteemed organization . I would specially thank MR. VIVEK SOOD, Project Guide, SLR Infotech Chandigarh for giving time and guidance throughout my training without whom it would have been impossible to attain success. My heartiest thanks to Trainees and employees at SLR Infotech Pvt. Ltd. Chandigarh for helping me throughout the project tenure. I own my regards to the entire faculty of the department of computer science and information technology at CHITKARA INSTITUTE OF ENGINEERING & TECHNOLGY from where I have learnt the basics of Computer Science and whose informal discussions and able guidance was a become light for me in the entire duration of this work. I would also like to thank my team members who worked with me and our combined efforts lead to the completion of the project.

Sachin Gupta 305030536

Preface
This project was undertaken at SLR INFOTECH PVT. LTD. , CHANDIGARH during industrial training Engineering to automate the system .The project is named as STUDENT MANAGEMENT SYTEM. The purpose of this report is to assemble under one cover a sufficient body of knowledge about management and development a successful software engineering project. The following quotes outlines the basic idea behind this technical report. This report assembles various functions like planning, organizing, designing, testing, and maintenance of the software developed during the Last Semester. This report is about the adaptation of the techniques of project development and reflects the practice and methods of software engineering project This report is intended for: Project managersThe report delivers the necessary information of the process a software development project Project coordinators The tutorial presents the state of the practice in software development and management techniques. Software engineers, programmers, analysts,and other computer personnel The report contains a general description ofand problems insoftware engineering project development, plus a number of methodologies and techniques for managing a software development project.

Sachin Gupta December 2006

ORGANIZATION PROFILE

SLR software is a leading technology company with the global out reach specializing in providing top solutions for all category users. Their strong commitment towards quality has secured us a privileged position in a fast evolving market, the key advantage being a state of art of product based on cutting edge technologies. The company delivers a full service offerings that helps numerous customers achieve maximum return on their investment through dedicated software experts, management tools and product selection consultation on business critical soft wares, including desktop, storage, security infrastructure and data management.

Company History
SLR InfoTech was founded in 1999 and is private owned. Since its first day of Business, SLR InfoTech has required no financial Banking or assistance the company has been self sufficient and profitable in all years of operation. The directors of company are Mr. Mohanbir Singh Chawla and Mr. Harminder Singh Chawla, who are highly educated and each having 5 to 7 years of experience in this industry. The company mission and culture has reminded constant over the years.

Goal
The goal of SLR InfoTech is to be responsive to its users and provide them with software solution to assist them in being more efficient and productive in their work. The company plans on continually improving software to help its clients take advantage new technology.

The company
Founded in 1999, SLR InfoTech is headquartered in Chandigarh, India. The activity is focused on the following major activity axes: Software Development Networking consultancy Project Management Software Export

The Company is Producing, developing and internationally distributing high quality software products. Providing integrated solutions for data security and reliable services in files like software distribution, consultancy and technical support. Providing solutions in banking, healthcare, insurance and publishing industry.

The People
The people are their key strength. They pick and nurture the best to create an awesome base of expertise and talent. They are a team of young professionals, enthusiastic and talented people. Software programmers, product managers or technical support people, the company is committed to provide their clients with high quality products and flawless technical support. The people working in sales, marketing and administration divisions are all client driven, closely co-operating with the software developers, therefore making them as an unbeatable team.

The Capabilities
The reliability of the products, the flexible licensing program and the low prices show their commitment towards their clients. SLR software strategic partnership with reputable companies allover the world has created a global network with excellent results and outstanding performance in the distribution of software products.

The Product
The products are characterized by innovation hip, ease of use and multiplatform supports. The software developed is supporting the large variety of operating systems. The systems undertaken by SLR InfoTech are as under: Developed publishing software for ICCC publications, which involved the compilation of all the cases of all high court and Supreme Court and effective search engine utility for finding relevant cases. Developing an in-house EPR projects for US based company, electrical company radius power. The company is into design, manufacturing and sales of electrical equipments like SNMPS, filters and EMI etc. The ERP software being developed cover productions, finance, marketing and sales & purchase modules. Designed and developed management system for a reputed employment or organization, VSS private limited, which specializes in human resource development. Developed an office Automation suite for the various offices of Vardaan sales LTD, a leading garment manufacturer of north India. Designed and developed an accounting software package for sporting LTD. Ludhiana. Developed a hospital Management System for a group of hospitals located in Jalandhar viz. Sanjivani Hospital, Navjeevan Hospital Designing and developing an in-house software IMMS integrated manufacturing management system for manufacturing industries incorporating the following functions: Financial Management Inventory management Store and purchase Human Resource management

Project Description And Objectives

Project Overview

Project Name Institute

: :

STUDENT MANAGEMENT SYSTEM SLR INFOTECH

Project Type Front End Back End Tool

: : : :

Development Project Java, Swings Microsoft Access Notepad

INTRODUCTION & OVERVIEW OF PROJECT

INTRODUCTION
The project is based on STUDENT MANAGEMENT SYSTEM. This project is carried out at SLR InfoTech Limited. This software firm deals in developing software for its clients. This a student management software, using Swings and Microsoft Access Database. First of all database and tables etc created in MS Office Access.

10

In modern civilization has become so complicated and sophisticated that to survive one has to be competitive. This compiles the people to be acquainted with all type of happening in the society; mankind is surrounded with a vast amount of data available. Modern business management system has also rendered in a fashion so that it can be utilized with minimum possible time. Paper files require a high amount of storage space and storage creates several other problems like fire risk, spoilage and deterioration by way of aging humidity etc. Computerization of documents and the files has solved this problem to create extent. Not only this, but it has to be high amount of relaxation to human mind, as everything can be automated. Now the documents can in a number of ways, styles and number of documents can be created as and when required without making any mistakes. The suitable of computerization for an application may be determined as follows: Volume of storage and calculation: Computerization is best suited to handle large volume of data. The sufficient, economic and reliable storage characteristic of computer media must be exploited properly. Quality of Output: Quality of output in terms of accuracy, elegance of output, aesthetics in formality through use of word processing and powerful editing could justify use of a computer. Computerized solutions should be cost justifiable: Money, time saving and efficiency justify the cost of preparing writing and executing a program, Now-computer devices such as calculator can perform money tasks more economically.

PROBLEM DEFINITION

11

The institute currently operates under a manual system of conducting exams of students. The primary function of the staff is to file and retrieve the information regarding the students, tests and tests type, performance reports of every student in different subjects, and to maintain batch records. There are the five major areas in which the manual system affects costs: Slow retrieval time results The system is labor and space intensive The manual system produces a risk of missing files There is a lack of confidently. No back up exists to support disaster recover.

The volume of paper is one of the things that stand in the way of increasing productivity in institute.

Document retrieval Costs


Because batches are rarely cross referenced, the staff might have to look under several headings to locate pertinent data. Even if the staff is conscientious about filling methods, locating documents is still a labor and cost intensive operation.

Value of missing information


Combined with the typical lost document statics reviewed above, one could estimate the industry average cost of not having the documents information when needed. But to obtain first hand actual data for as software organization. This company decided to measure that actual dollar value of lost information. Over a two week period, the file staff filled out a form for each request to retrieve a document from the storage rooms. The data collected documented the total number of filed requested and the results of each request.

Maintaining Registers is Costly


Traditionally, documents have been stored in batches and then filed in the cabinets and boxes. A numerical system is then assigned. Specially a batch number assigned to organize the files. Operative notes are classified alphabetically. Listed below are the cost elements in our paper based filling system:

Labor: Creating new files, labeling, applying batch header sheets to file into the system,
collating and entering information into a batch log book.

12

Supplies: File folders, dividers, folder labels, batch header sheets, requisitions slips, file
logs and filling boxes.

Equipment: File cabinets and shelving units

Drawbacks of the Existing System


Due to large of data a lot of complexities are involved in maintaining, updating and retrieving selected information, since old system is totally maintained manually, some of the complexities involved in existing system is as follows:

Redundancy of data: In the existing system, all data is maintained in


different files and registers. This often leads to considerable duplication of data and redundancy.

Difficulty in Updating the Data: Problem of updating data in the existing


systems since everything is stored in registered and files. It is very difficult and time consuming to update data

Delay in retrieving information: Retrieving information is quite time


consuming process because of large volume of data. If it is required to locate a particular record, a large number of registers have to be scanned.

Problem or keeping the data: As the data is voluminous, more space is


required to store it. Also, everything is stored on papers, so this type of storage is more prone to damage with time and due to other accidental factors.

No Integration of Relation between data: Present system does not


support any type of data integrity.

Not Informative: It is very difficult to get up to date information in the


existing system. If any information is required for any specific purpose. All the sorting to be done manually and the needs to be reentered at some other place

PROJECT OVERVIEW

13

This a student management software, using Java Swing and MS Office Database. First of all database and tables etc created in Oracle. Then the Web Interface allows users to manage it from anywhereusing just a web browser. The tomcat server can be used to serve the jsp pages in the centralserver where the database is running. Then user can access and manage it from any where after proper authentication. Administrators or manager etc are able to access the database according to there privilege after Authentication using passwords. A small city hospital requires to design database software to support the management and day to day operations of the hospital It has a medical director who has the overall responsibility of the management of the hospital. The hospital also has a personal officer who is responsible for ensuring that the appropriate number and type of staff are allocated to each ward and the out patient clinic. Each ward and the out patient clinic has a Charge Nurse responsible for overseeing the day to day operations of the ward/clinic. She is to ensure the recourses like staff, beds and supplies are used efficiently which the budget allocated for the purpose. Every week the charge nurse assigns either early, late or night shift to the staff of her ward. Each ward is also allocated senior junior nurses doctors and auxiliaries. Specialist staff (Consultants, Physiotherapists) is allocated to several wards or clinics. In Patients The charge Nurse and other senior medical staff are responsible for allocation of the bed for patients on the waiting list. Details of Patients in a ward and those on waiting list are both recorded. These include ( in addition to the other patient details mentioned earlier ) Date placed on the waiting list the ward required expected duration of stay in days date placed in the ward date expected to leave the ward actual date the patient left the ward bed number

( to be entered when known )

The Pharmaceutical as well as Surgical & Non surgical supplies used by each ward are monitored.

The software with its architectures provides cost, time administrative benefits. It uses pure client server architecture. The server is connected to many doctors over a LAN. The doctor

14

SQL queries to the server, which sends back database records (requested information) sequencing. Hospital Management System begun to make a mark with us: Fully web enabled with proven speed and operational efficiency Simplicity Compatibility (can be run on different operating systems) Data security and confidentiality (encrypted database resides on secure server) User friendliness (GUI based using J2EE as front end) Customized product details Instant result processing, cost, time and location effectiveness Less selection time, better management and fully computerized environment.

PROJECT PLANS

15

Team Structure
Team Will be comprising of two members. Our very able and helpful project guide Mr. Vivek Sood. Surbhi Bansal (Trainee), Chitkara Institute of Engineering & Technology ,Jansla(Pb).

Development Schedule
The work in developing the new system commented immediately with our first meeting with the management and users thereafter we were in continuous touch with the management and users of the company.

Phases Involved in the development of the system


Identify needs and benefits Held meetings with the management and user Studied and identified the existing system. Identify needs and project constraints Established project statements Prepared a detailed report of the existing system at work. Prepare the software requirement specifications . Actual coding started

Introduction
The very first step of developing any system is to study the whole existing system this is called the initial study, analysis and feasibility of the project is being done. Analysis is the detailed study of the various operations performed by the system and their relationship within and outside the system. In context to this project although the records are not maintained on the daily basis but the same procedure is repeated each day and everyday. Hence the need for the computerization is necessary to make the work easier and more comfortable. The feasibility study is carried out to select the best process that meets the performance requirements. This entails identification, description and evaluation of the candidate process and the selection of the best candidate process for the job. Now according to this project the analysis is to have the complete knowledge about how the software that is going to develop is going to function. From where is the input going to come and what will be the output vs. what is the required output. Once analysis is done or completed the analyst has the firm knowledge of what is to be done. The next step is to decide how the problem might

16

be solved. Thus, in systems design, we move from the logical to the physical aspects of the life cycle. So the conclusion of the initial study is that the computerized version of the existing system of the institute will be able to serve its teachers and students in more efficient manner as this type of system will save their lot of tremendous time, energy, tiring, and repetitive paperwork

Existing System
As stated earlier in the introduction to the project, Hospital system at thepresent time is totally manaual.the variousinformation related to the patients is entered in the registers. Calculations of bills of the different category products and preparing results of the each and every visitor to the store are very tedious work for the administrator. The Administrator Office of the hospital is unable to keep with the pace of the increasing demands of its rapid growth. The office currently operates under a manual system of filing and retrieving documentation. These documents prepared manually like performance reports of every patient, final bill report In the manual system, searching for some specific information is the time consuming exercise. A number of registers are being maintained. Proper upkeep of the register is very difficult, as only the concerned person know where the desired information is available. The system is highly resource intensive as well as prone to errors. Piles of registers are there as new additions to these existing piles are occurring as time passes. There are five major areas in which the manual system affects costs: Slow retrieval time results in delayed or lost income. The system is labor and space intensive. The manual system produces a risk of missing files which causes lost income. There is a lack of confidentiality. No back up to support disaster recovery.

Proposed System
Hospital management sytem an attempt to take a step towards paperlesswork. Hospital management sytem a multi-user, user friendly and GUI based application software. In this system every doctor will need to have only a single computer terminal, which is attached to the server of the hospital. Any query related to the product will be served from the centralized database server at the Hospital .This Login and Password should be kept confidential as this can provide access to each and every module of the website.Thus,system ensures the security from the unauthorized access other than the doctor of the hospital The system offers the functionality at client/server.

17

Salient Features in Proposed System:


User friendly. Providing protection to data, through password. Efficient retrieval of information. Ensure accuracy of data, with in-built validations and checks. Efficient linkage of information. Informative reports. Elimination of paper works to a great extent.

Functions to be provided:
The proposed system is based on information made available by the administration section. The data pertaining to various transactions of the students will be fed to system through the data entry screens to generate database in the required form. The new system will provide data in processed and consolidated form taking care of the purpose being served by the specific tables being already maintained. The access to this package will be provided only through a password. The data entry will be possible through the respective forms. Each and every type of queries is proposed to deal with specific areas of customers, products, and other relatedmodules.

Proposed Strategy:
The software is made using J2EE(JSP) and HTML as Front End and SQL(Oracle) as back end. This gives us the knack to develop application software, which ensures that software can be accessed on any Microsoft platform that supports Common Language Runtime.Microsoft SQL gives the ability to handle the large database. So software can be used for the small as well as the large shopping stores. SQL has the advantage of importing and exporting the database easily.

18

SYSTEM REQUIREMENT ANALYSIS


Prior to the software development efforts in any type of system it is very essential to understand the requirements of the systems and users. A complete specification of the software is the 1st step is the analysis of system. Requirements analysis provides the designer with the representation of functions and procedures that can be translated into data, architecture and procedural design. The goal of requirement analysis is to find out how the current system is working and if there are any areas where improvement is necessary and possible. This may result in using alternative ways to data capturing and processing.

INTERFACE REQUIREMENT
1. User Interface The package must be user friendly and robust. It must prompt the user with proper message boxes to help them perform various actions and how to precede further the system must respond normally under any in out conditions and display proper message instead of turning up faults and errors. 2. Hardware Specification SPECIFICATION Intel Pentium IV 1.5GHz 256 MB 40GB 105 Keys HARDWARE CPU SPEED RAM HARD DISK KEYBOARD

Software Specifications
Software is a set of program, documents, and procedure, routines associated with computer system. Software is an essential complement to hardware. It is the computer programs which when Student Management System has been developed using the following tools: Java Swing, Awt SQL (as back end)

19

ANALYSIS OF THE PROJECT


This a student management software, using Java Swing and Microsoft Access Database. This project basically deals with the student management system, it deals with how to add a record of the student, how to modify or delete the student record. In this project we convert the manually student management into computerized system for our convenience or data reliability. This has basically four forms. The first form is welcome form that specify the welcome to the student management project. The second form is login form and it evaluate the user name and password with the database. The add student record specify how to add the student record and specify the student relative fields. And the last form is modify students record or delete students record.

SYSTEM DEVELOPMENT LIFE CYCLE MODEL (SDLC MODEL)


This is also known as Classic Life Cycle Model (or) Linear Sequential Model (or) Waterfall Method. This has the following activities. 1. System/Information Engineering and Modeling 2. Software Requirements Analysis 3. Systems Analysis and Design 4. Code Generation

20

5. Testing 6. Maintenance System/Information Engineering and Modeling As software is always of a large system (or business), work begins by establishing requirements for all system elements and then allocating some subset of these requirements to software. This system view is essential when software must interface with other elements such as hardware, people and other resources. System is the basic and very critical requirement for the existence of software in any entity. So if the system is not in place, the system should be engineered and put in place. In some cases, to extract the maximum output, the system should be re-engineered and spruced up. Once the ideal system is engineered or tuned, the development team studies the software requirement for the system. Software Requirement Analysis This is also known as feasibility study. In this phase, the development team visits the customer and studies their system. They investigate the need for possible software automation in the given system. By the end of the feasibility study, the team furnishes a document that holds the different specific recommendations for the candidate system. It also includes the personnel assignments, costs, project schedule, and target dates. The requirements gathering process is intensified and focused specially on software. To understand the nature of the program(s) to be built, the system engineer ("analyst") must understand the information domain for the software, as well as required function, behavior, performance and interfacing. The essential purpose of this phase is to find the need and to define the problem that needs to be solved.

System Analysis and Design In this phase, the software development process, the software's overall structure and its nuances are defined. In terms of the client/server technology, the number of tiers needed for the package architecture, the database design, the data structure design etc are all defined in this phase. A software development model is created. Analysis and Design are very crucial in the whole development cycle. Any glitch in the design phase could be very expensive to solve in the later stage of the software development. Much care is taken during this phase. The logical system of the product is developed in this phase.

Code generation

21

The design must be translated into a machine-readable form. The code generation step performs this task. If the design is performed in a detailed manner, code generation can be accomplished without much complication. Programming tools like Compilers, Interpreters, and Debuggers are used to generate the code. Different high level programming languages like C, C++, Pascal, and Java are used for coding. With respect to the type of application, the right programming language is chosen. Testing Once the code is generated, the software program testing begins. Different testing methodologies are available to unravel the bugs that were committed during the previous phases. Different testing tools and methodologies are already available. Some companies build their own testing tools that are tailor made for their own development operations.

JAVA
Java Technology is both a programming language and a platform. Java: The Programming Language The Java programming language is a high level language that can be characterized by all of the following buzzwords: Simple Object oriented Distributed Interpreted

22

Robust Secure Architecture neutral Portable High performance Multithreaded

With most programming languages, you either compile or interpret a program so that you can run it on your computer. The Java programming language is unusual in that a program is both compiled and interpreted. With the compiler, first you translate a program into an intermediate language called Java byte codes the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java byte code instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed. The following figure illustrates how this works.

23

You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether it's a development tool or a Web browser that can run applets, is an implementation of the Java VM. Java byte codes help make "write once, run anywhere" possible. You can compile your program into byte codes on any platform that has a Java compiler. The byte codes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.

Java: The Platform A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms like Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms. The Java platform has two components:

The Java Virtual Machine (Java VM) The Java Application Programming Interface (Java API)

Java Virtual Machine is standardized hypothetical computer, which is emulated inside our computer by a program. It is base of Java platform and is ported onto various hardware-based platforms. The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.

24

The following figure depicts a program that's running on the Java platform. As the figure shows, the Java API and the virtual machine insulate the program from the hardware.

What Can Java Technology Do? The most common types of programs written in the Java programming language are applets and applications. If you've accessed the Web, you're probably already familiar with applets. An applet is a program that adheres to certain conventions that allow it to run within a Java-enabled browser. However, the Java programming language is not just for writing cute, entertaining applets for the Web. The general-purpose, high-level Java programming language is also a powerful software platform. Using the generous API, you can write many types of programs. An application is a standalone program that runs directly on the Java platform. A special kind of application known as a server serves and supports clients on a network. Examples of servers are Web servers, proxy servers, mail servers, and print servers. Another specialized program is a servlet. A servlet can almost be thought of as an applet that runs on the server side. Java Servlets are a popular choice for building interactive web applications, replacing the use of CGI scripts. Servlets are similar to applets in that they are runtime extensions of applications. Instead of working in browsers, though, servlets run within Java Web servers, configuring or tailoring the server.

JFC and Swing JFC and Swing is a part of java extension. JFC is short for Java Foundation Classes, which encompass a group of features to help people build graphical user interfaces (GUIs). The JFC was first announced at the 1997 Java One developer conference and is defined as containing the following features: The Swing Components Include everything from buttons to split panes to tables.

25

Pluggable Look and Feel Support It gives any program that uses Swing components a choice of looks and feels. For example, the same program can use either the Java look and feel or the Windows look and feel. We expect many more look-and-feel packages -- including some that use sound instead of a visual "look" -- to become available from various sources.

Accessibility API It enables assistive technologies such as screen readers and Braille displays to get information from the user interface.

Java 2DTM API (Java 2 Platform only) It enables developers to easily incorporate high-quality 2D graphics, text, and images in applications and in applets.

Drag and Drop Support (Java 2 Platform only)

Provides the ability to drag and drop between a Java application and a native application. The Swing API is available in two forms: As a core part of the Java 2 Platform, Standard Edition (including versions 1.2, 1.3, and 1.4) JFC 1.1 (for use with JDK 1.1) Sun community recommends that to use the latest version of the Java 2 Platform. Not only will you be getting the latest bug fixes, but you'll get more features. (As we used JSDK1.5.0_01 version, which is the latest release of java development kit up to the time of written of this report.)

26

JDBC
Setting up a Database We will assume that the database COFFEEBREAK already exists. (Creating a database is not at all difficult, but it requires special permissions and is normally done by a database administrator.) When you create the tables used as examples in this tutorial, they will be in the default database. We purposely kept the size and number of tables small to keep things manageable. Suppose that our sample database is being used by the proprietor of a small coffee house called The Coffee Break, where coffee beans are sold by the pound and brewed coffee is sold by the cup. To keep things simple, also suppose that the proprietor needs only two tables, one for types of coffee and one for coffee suppliers. First we will show you how to open a connection with your DBMS, and then, since what JDBC does is to send your SQL code to your DBMS, we will demonstrate some SQL code. After that, we will show you how easy it is to use JDBC to pass these SQL statements to your DBMS and process the results that are returned. This code has been tested on most of the major DBMS products. However, you may encounter some compatibility problems using it with older ODBC drivers with the JDBCODBC Bridge. Establishing a Connection The first thing you need to do is establish a connection with the DBMS you want to use. This involves two steps: (1) loading the driver and (2) making the connection. Loading Drivers Loading the driver or drivers you want to use is very simple and involves just one line of code. If, for example, you want to use the JDBC-ODBC Bridge driver, the following code will load it: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Your driver documentation will give you the class name to use. For instance, if the class name is jdbc.DriverXYZ , you would load the driver with the following line of code: Class.forName("jdbc.DriverXYZ"); You do not need to create an instance of a driver and register it with the DriverManager because calling Class.forName will do that for you automatically. If you were to create your own instance, you would be creating an unnecessary duplicate, but it would do no harm.

27

When you have loaded a driver, it is available for making a connection with a DBMS. Making the Connection The second step in establishing a connection is to have the appropriate driver connect to the DBMS. The following line of code illustrates the general idea: Connection con = DriverManager.getConnection(url, "myLogin", "myPassword"); This step is also simple, with the hardest thing being what to supply for url . If you are using the JDBC-ODBC Bridge driver, the JDBC URL will start with jdbc:odbc: . The rest of the URL is generally your data source name or database system. So, if you are using ODBC to access an ODBC data source called " Fred, " for example, your JDBC URL could be jdbc:odbc:Fred . In place of " myLogin " you put the name you use to log in to the DBMS; in place of " myPassword " you put your password for the DBMS. So if you log in to your DBMS with a login name of " Fernanda " and a password of " J8, " just these two lines of code will establish a connection: String url = "jdbc:odbc:Fred"; Connection con = DriverManager.getConnection(url, "Fernanda", "J8"); If you are using a JDBC driver developed by a third party, the documentation will tell you what subprotocol to use, that is, what to put after jdbc: in the JDBC URL. For example, if the driver developer has registered the name acme as the subprotocol, the first and second parts of the JDBC URL will be jdbc:acme: . The driver documentation will also give you guidelines for the rest of the JDBC URL. This last part of the JDBC URL supplies information for identifying the data source. If one of the drivers you loaded recognizes the JDBC URL supplied to the method DriverManager.getConnection , that driver will establish a connection to the DBMS specified in the JDBC URL. The DriverManager class, true to its name, manages all of the details of establishing the connection for you behind the scenes. Unless you are writing a driver, you will probably never use any of the methods in the interface Driver , and the only DriverManager method you really need to know is DriverManager.getConnection . The connection returned by the method DriverManager.getConnection is an open connection you can use to create JDBC statements that pass your SQL statements to the DBMS. In the previous example, con is an open connection, and we will use it in the examples that follow.

28

Creating JDBC Statements A Statement object is what sends your SQL statement to the DBMS. You simply create a Statement object and then execute it, supplying the appropriate execute method with the SQL statement you want to send. For a SELECT statement, the method to use is executeQuery . For statements that create or modify tables, the method to use is executeUpdate . It takes an instance of an active connection to create a Statement object. In the following example, we use our Connection object con to create the Statement object stmt : Statement stmt = con.createStatement(); At this point stmt exists, but it does not have an SQL statement to pass on to the DBMS. We need to supply that to the method we use to execute stmt . For example, in the following code fragment, we supply executeUpdate with the SQL statement from the example above: stmt.executeUpdate("CREATE TABLE COFFEES " + "(COF_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, " + "SALES INTEGER, TOTAL INTEGER)"); Since we made a string out of the SQL statement and assigned it to the variable createTableCoffees , we could have written the code in this alternate form: stmt.executeUpdate(createTableCoffees); Executing Statements We used the method executeUpdate because the SQL statement contained in createTableCoffees is a DDL (data definition language) statement. Statements that create a table, alter a table, or drop a table are all examples of DDL statements and are executed with the method executeUpdate . As you might expect from its name, the method executeUpdate is also used to execute SQL statements that update a table. In practice, executeUpdate is used far more often to update tables than it is to create them because a table is created once but may be updated many times. The method used most often for executing SQL statements is executeQuery . This method is used to execute SELECT statements, which comprise the vast majority of SQL statements. You will see how to use this method shortly.

29

Entering Data into a Table We have shown how to create the table COFFEES by specifying the names of the columns and the data types to be stored in those columns, but this only sets up the structure of the table. The table does not yet contain any data. We will enter our data into the table one row at a time, supplying the information to be stored in each column of that row. Note that the values to be inserted into the columns are listed in the same order that the columns were declared when the table was created, which is the default order. The following code inserts one row of data, with Colombian in the column COF_NAME , 101 in SUP_ID , 7.99 in PRICE , 0 in SALES , and 0 in TOTAL . (Since The Coffee Break has just started out, the amount sold during the week and the total to date are zero for all the coffees to start with.) Just as we did in the code that created the table COFFEES , we will create a Statement object and then execute it using the method executeUpdate . Since the SQL statement will not quite fit on one line on the page, we have split it into two strings concatenated by a plus sign (+) so that it will compile. Pay special attention to the need for a space between COFFEES and VALUES . This space must be within the quotation marks and may be after COFFEES or before VALUES ; without a space, the SQL statement will erroneously be read as " INSERT INTO COFFEESVALUES . . ." and the DBMS will look for the table COFFEESVALUES . Also note that we use single quotation marks around the coffee name because it is nested within double quotation marks. For most DBMSs, the general rule is to alternate double quotation marks and single quotation marks to indicate nesting. Statement stmt = con.createStatement(); stmt.executeUpdate( "INSERT INTO COFFEES " + "VALUES ('Colombian', 101, 7.99, 0, 0)"); The code that follows inserts a second row into the table COFFEES . Note that we can just reuse the Statement object stmt rather than having to create a new one for each execution. stmt.executeUpdate("INSERT INTO COFFEES " + "VALUES ('French_Roast', 49, 8.99, 0, 0)"); Values for the remaining rows can be inserted as follows: stmt.executeUpdate("INSERT INTO COFFEES " + "VALUES ('Espresso', 150, 9.99, 0, 0)"); stmt.executeUpdate("INSERT INTO COFFEES " + "VALUES ('Colombian_Decaf', 101, 8.99, 0, 0)"); stmt.executeUpdate("INSERT INTO COFFEES " +

"VALUES ('French_Roast_Decaf', 49, 9.99, 0, 0)");

30

Getting Data from a Table Now that the table COFFEES has values in it, we can write a SELECT statement to access those values. The star (*) in the following SQL statement indicates that all columns should be selected. Since there is no WHERE clause to narrow down the rows from which to select, the following SQL statement selects the whole table: SELECT * FROM COFFEES The result, which is the entire table, will look similar to the following: COF_NAME --------------Colombian French_Roast Espresso Colombian_Decaf French_Roast_Decaf SUP_ID -----101 49 150 101 49 PRICE ----7.99 8.99 9.99 8.99 9.99 SALES ----0 0 0 0 0 TOTAL ----0 0 0 0 0

The result above is what you would see on your terminal if you entered the SQL query directly to the database system. When we access a database through a Java application, as we will be doing shortly, we will need to retrieve the results so that we can use them. You will see how to do this in the next section. Here is another example of a SELECT statement; this one will get a list of coffees and their respective prices per pound: SELECT COF_NAME, PRICE FROM COFFEES The results of this query will look something like this: COF_NAME ----------------Colombian French_Roast Espresso Colombian_Decaf French_Roast_Decaf PRICE ----7.99 8.99 9.99 8.99 9.99

The SELECT statement above generates the names and prices of all of the coffees in the table. The following SQL statement limits the coffees selected to just those that cost less than $9.00 per pound: SELECT COF_NAME, PRICE 31

FROM COFFEES WHERE PRICE < 9.00 The results would look similar to this: COF_NAME -------------Colombian French_Roast Colombian Decaf PRICE ----7.99 8.99 8.99

Retrieving Values from Result Sets We now show how you send the above SELECT statements from a program written in the Java programming language and how you get the results we showed. JDBC returns results in a ResultSet object, so we need to declare an instance of the class ResultSet to hold our results. The following code demonstrates declaring the ResultSet object rs and assigning the results of our earlier query to it: ResultSet rs = stmt.executeQuery( "SELECT COF_NAME, PRICE FROM COFFEES"); Using the Method next The variable rs , which is an instance of ResultSet , contains the rows of coffees and prices shown in the result set example above. In order to access the names and prices, we will go to each row and retrieve the values according to their types. The method next moves what is called a cursor to the next row and makes that row (called the current row) the one upon which we can operate. Since the cursor is initially positioned just above the first row of a ResultSet object, the first call to the method next moves the cursor to the first row and makes it the current row. Successive invocations of the method next move the cursor down one row at a time from top to bottom. Note that with the JDBC 2.0 API, covered in the next section, you can move the cursor backwards, to specific positions, and to positions relative to the current row in addition to moving the curs or forward.

Using the getXXX Methods We use the getXXX method of the appropriate type to retrieve the value in each column. For example, the first column in each row of rs is COF_NAME , which stores a value of SQL type VARCHAR . The method for retrieving a value of SQL type VARCHAR is

32

getString . The second column in each row stores a value of SQL type FLOAT , and the method for retrieving values of that type is getFloat . The following code accesses the values stored in the current row of rs and prints a line with the name followed by three spaces and the price. Each time the method next is invoked, the next row becomes the current row, and the loop continues until there are no more rows in rs .
String query = "SELECT COF_NAME, PRICE FROM COFFEES"; ResultSet rs = stmt.executeQuery(query); while (rs.next()) { String s = rs.getString("COF_NAME"); float n = rs.getFloat("PRICE"); System.out.println(s + " " + n); } The output will look something like this: Colombian 7.99 French_Roast 8.99 Espresso 9.99 Colombian_Decaf 8.99 French_Roast_Decaf 9.99 Note that we use a curved arrow to identify output from JDBC code; it is not part of the output. The arrow is not used for results in a result set, so its use distinguishes between what is contained in a result set and what is printed as the output of an application. Let's look a little more closely at how the getXXX methods work by examining the two getXXX statements in this code. First let's examine getString . String s = rs.getString("COF_NAME"); The method getString is invoked on the ResultSet object rs , so getString will retrieve (get) the value stored in the column COF_NAME in the current row of rs . The value that getString retrieves has been converted from an SQL VARCHAR to a String in the Java programming language, and it is assigned to the String object s . Note that we used the variable s in the println expression shown above, that is, println(s + " " + n) . The situation is similar with the method getFloat except that it retrieves the value stored in the column PRICE , which is an SQL FLOAT , and converts it to a Java float before assigning it to the variable n . JDBC offers two ways to identify the column from which a getXXX method gets a value. One way is to give the column name, as was done in the example above. The second way is

33

to give the column index (number of the column), with 1 signifying the first column, 2 , the second, and so on. Using the column number instead of the column name looks like this: String s = rs.getString(1); float n = rs.getFloat(2); The first line of code gets the value in the first column of the current row of rs (column COF_NAME ), converts it to a Java String object, and assigns it to s . The second line of code gets the value stored in the second column of the current row of rs , converts it to a Java float , and assigns it to n . Note that the column number refers to the column number in the result set, not in the original table. In summary, JDBC allows you to use either the column name or the column number as the argument to a getXXX method. Using the column number is slightly more efficient, and there are some cases where the column number is required. In general, though, supplying the column name is essentially equivalent to supplying the column number. JDBC allows a lot of latitude as far as which getXXX methods you can use to retrieve the different SQL types. For example, the method getInt can be used to retrieve any of the numeric or character types. The data it retrieves will be converted to an int ; that is, if the SQL type is VARCHAR , JDBC will attempt to parse an integer out of the VARCHAR . The method getInt is recommended for retrieving only SQL INTEGER types, however, and it cannot be used for the SQL types BINARY, VARBINARY, LONGVARBINARY, DATE, TIME, or TIMESTAMP. Using the Method getString Although the method getString is recommended for retrieving the SQL types CHAR and VARCHAR, it is possible to retrieve any of the basic SQL types with it. (You cannot, however, retrieve the new SQL3 datatypes with it. We will discuss SQL3 types later in this tutorial.) Getting all values with getString can be very useful, but it also has its limitations. For instance, if it is used to retrieve a numeric type, getString will convert the numeric value to a Java String object, and the value will have to be converted back to a numeric type before it can be operated on as a number. In cases where the value will be treated as a string anyway, there is no drawback. Further, if you want an application to retrieve values of any standard SQL type other than SQL3 types, use the getString method. Updating Tables Suppose that after a successful first week, the proprietor of The Coffee Break wants to update the SALES column in the table COFFEES by entering the number of pounds sold for each type of coffee. The SQL statement to update one row might look like this: String updateString = "UPDATE COFFEES + 34

"SET SALES = 75 " + "WHERE COF_NAME LIKE 'Colombian'"; Using the Statement object stmt, this JDBC code executes the SQL statement contained in updateString : stmt.executeUpdate(updateString); The table COFFEES will now look like this: COF_NAME ------------Colombian French_Roast Espresso Colombian_Decaf French_Roast_Decaf SUP_ID ----101 49 150 101 49 PRICE SALES ----- ----7.99 75 8.99 0 9.99 0 8.99 0 9.99 0 TOTAL 0 0 0 0 0

Note that we have not yet updated the column TOTAL, so it still has the value 0 . Now let's select the row we updated, retrieve the values in the columns COF_NAME and SALES, and print out those values: String query = "SELECT COF_NAME, SALES FROM COFFEES + "WHERE COF_NAME LIKE 'Colombian'"; ResultSet rs = stmt.executeQuery(query); while (rs.next()) { String s = rs.getString("COF_NAME"); int n = rs.getInt("SALES"); System.out.println(n + " pounds of " + s + " sold this week."); } This will print the following: 75 pounds of Colombian sold this week. Since the WHERE clause limited the selection to only one row, there was just one row in the ResultSet rs and one line printed as output. Accordingly, it is possible to write the code without a while loop: rs.next(); String s = rs.getString(1); int n = rs.getInt(2); System.out.println(n + " pounds of " + s + " sold this week.");

35

Even when there is only one row in a result set, you need to use the method next to access it. A ResultSet object is created with a cursor pointing above the first row. The first call to the next method positions the cursor on the first (and in this case, only) row of rs . In this code, next is called only once, so if there happened to be another row, it would never be accessed. Now let's update the TOTAL column by adding the weekly amount sold to the existing total, and then let's print out the number of pounds sold to date: String updateString = "UPDATE COFFEES + "SET TOTAL = TOTAL + 75 " + "WHERE COF_NAME LIKE 'Colombian'"; stmt.executeUpdate(updateString); String query = "SELECT COF_NAME, TOTAL FROM COFFEES + "WHERE COF_NAME LIKE 'Colombian'"; ResultSet rs = stmt.executeQuery(query); while (rs.next()) { String s = rs.getString(1); int n = rs.getInt(2); System.out.println(n + " pounds of " + s + " sold to date."); } Note that in this example, we used the column index instead of the column name, supplying the index 1 to getString (the first column of the result set is COF_NAME), and the index 2 to getInt (the second column of the result set is TOTAL). It is important to distinguish between a column's indexes in the database table as opposed to its index in the result set table. For example, TOTAL is the fifth column in the table COFFEES but the second column in the result set generated by the query in the example as above.

36

INITIAL STUDY OF PROJECT

37

DATABASE TABLES

DataBase tables used in STUDENT MANGEMENT SYSTEM


CREATE TABLE login ( Login TEXT(20), Password TEXT(20) ) CREATE TABLE Student_details ( Registration _no AUTONUMBER(), Name TEXT(20), preaddress TEXT(20), permaaddress TEXT(20), fathername TEXT(20), dateofbirth TEXT(20), fatheroccupation TEXT(20), phone TEXT(20), gender TEXT(20), year TEXT(20), course TEXT(20), dmc TEXT(20), degree TEXT(20), charcerti TEXT(20), ncccerti TEXT(20) );

38

SNAP SHOTS
Main page of the Student Management Software

39

Login Page

This is login page and it verify the login with the database if it math then other forms open else it shows the dialog that indicates invalid username and password.

40

Add Student Record Page

This form is used to add the student record into the database.

41

Modify or Delete Student Details Page

This form performs the deletion and modification of the student record.

Conclusions
42

This project that I undertook was truly a very rewarding experience for me in more than one way. It has given a big thrust to my technical knowledge as prospective Software professional. It has also helped me enhance my skills on the personal front. And I feel extremely satisfied by the fact that I have managed to develop the project of course with equal contribution from my team members. I think I have exploited the opportunity that came my way to the fullest extent by increasing my technical know-how and also gaining the valuable work experience apart from studying the other subjects in our curriculum.

43

You might also like