You are on page 1of 73

A Project Report On

Student Management Student


Submitted to

Project Guide:

Submitted by:

CONTENTS

1. Technology used in project and other compatible technologies 2. Project Undertaken 3. Introduction to project 4. Project Analysis (a) Project Planning (b) Division of time of work (c) Project requirement & specification 5. Project design (a) Dataflow diagram (b) Database design (c) Snapshots of Forms with some coding. 6. Project Testing 7. Maintenance 8. Project security 9. Project implementation 10. Conclusion References

Technology Used in the Project


Introduction
When the chronicle of computer languages is written, the following will be said: B led to C, C evolved into C++, and C++ set the stage for Java. To understand Java is to understand the reasons that drove its creation, the forces that shaped it, and the legacy that it inherits. Like the successful computer languages that came before, Java is a blend of the best elements of its rich heritage combined with the innovative concepts required by its unique environment. Although Java has become inseparably linked with the online environment of the Internet, it is important to remember that Java is first and foremost a programming language. Computer language innovation and development occurs for two fundamental reasons: o To adapt to changing environments and uses o To implement refinements and improvements in the art of programming As you will see, the creation of Java was driven by both elements in nearly equal measure.

History
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. Between the initial implementation of Oak in the fall of 1992 and the public announcement of Java in the spring of 1995, many more people contributed to the design and evolution of the language. Bill Joy, Arthur van Hoff, Jonathan Payne, Frank Yellin, and Tim Lindholm were key contributors to the maturing of the original prototype. Somewhat surprisingly, the original impetus for Java was not the Internet! Instead, the primary motivation was the need for a platform-independent (that is, architectureneutral) language that could be used to create software to be embedded in various consumer electronic devices, such as microwave ovens and remote controls. As you can probably guess, many different types of CPUs

are used as controllers. The trouble with C and C++ (and most other languages) is that they are designed to be compiled for a specific target. Although it is possible to compile a C++ program for just about any type of CPU, to do so requires a full C++ compiler targeted for that CPU. The problem is that compilers are expensive and time-consuming to create. An easier and more cost-efficientsolution was needed. In an attempt to find such a solution, Gosling and others began work on a portable, platform-independent language that could be used to produce code that would run on a variety of CPUs under differing environments. This effort ultimately led to the creation of Java.

Feature
Although the fundamental forces that necessitated the invention of Java are portability and security, other factors also played an important role in molding the final form of the language. These features are as follows: o Simple : Java was designed to be easy for the professional programmer to learn and use effectively. Assuming that you have some programming experience, you will not find Java hard to master. If you already understand the basic concepts of object-oriented programming, learning Java will be even easier. o Secure: As you are likely aware, every time that you download a normal program, you are risking a viral infection. Prior to Java, most users did not download executable programs frequently, and those who did scanned them for viruses prior to execution. Even so, most users still worried about the possibility of infecting their systems with a virus. In addition to viruses, another type of malicious program exists that must be guarded against. This type of program can gather private information, such as credit card numbers, bank account balances, and passwords, by searching the contents of your computers local file system. Java answers both of these concerns by providing a firewall between a networked application and your computer. When you use a Java-compatible Web browser, you can safely download Java applets without fear of viral infection or malicious intent. o Object-oriented: Although influenced by its predecessors, Java was not designed to be source-code compatible with any other language. This allowed the Java

team the freedom to design with a blank slate. One outcome of this was a clean, usable, pragmatic approach to objects. Borrowing liberally from many seminal object-software environments of the last few decades, Java manages to strike a balance between the purists everything is an object paradigm and the pragmatists stay out of my way model. The object model in Java is simple and easy to extend, while simple types, such as integers, are kept as high-performance nonobjects. o Robust: The multiplatformed environment of the Web places extraordinary demands on a program, because the program must execute reliably in a variety of systems. Thus, the ability to create robust programs was given a high priority in the design of Java. To gain reliability, Java restricts you in a few key areas, to force you to find your mistakes early in program development. o Multithreaded: Java was designed to meet the real-world requirement of creating interactive, networked programs. To accomplish this, Java supports multithreaded programming, which allows you to write programs that do many things simultaneously. o Architecture-neutral: A central issue for the Java designers was that of code longevity and portability. One of the main problems facing programmers is that no guarantee exists that if you write a program today, it will run tomorroweven on the same machine. Operating system upgrades, processor upgrades, and changes in core system resources can all combine to make a program malfunction. The Java designers made several hard decisions in the Java language and the Java Virtual Machine in an attempt to alter this situation. Their Goal was write once; run anywhere, any time, forever. To a great extent, this goal was accomplished. o Interpreted & High performance: Java enables the creation of cross-platform programs by compiling into an intermediate representation called Java byte code. This code can be interpreted on any system that provides a Java Virtual Machine. Most previous attempts at cross platform solutions have done so at the expense of performance. Other interpreted systems, such as BASIC, Tcl, and PERL, suffer from almost insurmountable performance deficits. Java, however, was designed

to perform well on very low-power CPUs. As explained earlier, while it is true that Java was engineered for interpretation, the Java byte code was carefully designed so that it would be easy to translate directly into native machine code for very high performance by using a just-in-time compiler. Java run-time systems that provide this feature lose none of the benefits of the platform-independent code. High-performance cross-platform is no longer an oxymoron. o o Distributed: Java is designed for the distributed environment of the Internet, because it handles TCP/IP protocols. Dynamic: Java programs carry with them substantial amounts of run-time type information that is used to verify and resolve accesses to objects at run time. This makes it possible to dynamically link code in a safe and expedient manner. This is crucial to the robustness of the applet environment, in which small fragments of bytecode may be dynamically updated on a running system.

Tools & Technologies:


The JDK comes with a collection of tools that are used for developing and running Java programs which includes: Appletviewer : Enables us to run Java applets(without having a compatible browser) Javac: Java Compiler ,which translates Java source code to bytecode files that the interpreter can understand. Java: Java Interpreter, which runs applets and applications by reading and interpreting byte code files. Javah: Produces header files for use with native methods. Javadoc: Creates HTML format documentation from Java source code files.

Jdb: Java debugger, which finds errors in programs.

Package & Interface:


Packages and interfaces are two of the basic components of a Java program. Packages are containers for classes that are used to keep the class name space compartmentalized. For example, a package allows you to create a class named List, which you can store in your own package without concern that it will collide with some other class named List stored elsewhere. Packages are stored in a hierarchical manner and are explicitly imported into new class definitions. The use of the interface keyword, Java allows you to fully abstract the Interface from its implementation. Using interface, you can specify a set of methods which can be implemented by one or more classes. The interface, itself, does not actually define any implementation. Although they are similar to abstract classes, interfaces have an additional capability: A class can implement more than one interface.

AWT classes & its Controls:


All applets must import java.applet. Applets must also import java.awt. Recall that AWT stands for the Abstract Window Toolkit. Since all applets run in a window, it is necessary to include support for that window. Controls are components that allow a user to interact with your application in various waysfor example, a commonly used control is the push button. A layout manager automatically positions components within a container. Thus, the appearance of a window is determined by a combination of the controls that it contains and the layout manager used to position them. In addition to the controls, a frame window can also include a standardstyle menu bar. Each entry in a menu bar activates a drop-down menu of options from which the user can choose. A menu bar is always positioned at the top of a window. Although different in appearance, menu bars are handled in much the same way as are the other controls.

Applets:
The Applet class is contained in the java.applet package. Applet contains several methods that give you detailed control over the execution of your applet. In addition, java.applet also defines three interfaces: AppletContext, AudioClip, and AppletStub.

Swings:
Unlike AWT components, Swing components are not implemented by Platform-specific code. Instead, they are written entirely in Java and, therefore, are Platform-independent. The term lightweight is used to describe such elements. Swing is a set of classes that provides more powerful and flexible components than are possible with the AWT. In addition to the familiar components, such as buttons, check boxes, and labels, Swing supplies several exciting additions, including tabbed panes, scroll panes, trees, and tables.

RMI:
Remote Method Invocation (RMI) allows a Java object that executes on one machine to invoke a method of a Java object that executes on another machine. This is an important feature, because it allows you to build distributed applications.

Project Undertaken
1. Administrative cell in the Maharishi Markandeshwar University,Mullana.has been doing a yeoman service in managing students records and their personal information. The broad functions of Administrative cell are: a) Manages personal Information of Students. b) Manages past Records of Students. c) Manages Enquiry from students regarding their courses. 2. Presently, the entire process is done manually using MS-Office & is being repeated semester after semester. It requires huge amount of data to be collected from time to time. It is felt that in this IT era, the manual process is time consuming, complex & error prone. In order to streamline the entire process, it has been decided to assign the project to the student of semester 5th CSE as minor project. 3. The terms of reference for the project are as below. a) Identify student database to be maintained & updated on the regular basis. b) Analyze the existing system. c) The software will be developed using core Java & Database (MS-Access). 4. The project will commence from 1st July 2009 and Completed by 14th September, 2009. 5. This project will work under the strict guidance of Mr. Mukesh Batra 6. The project report will be submitted at the end of September 2009 All the concerned departmental heads and the other staff are requested to extend full support in completion of the project.

Introduction To PROJECT
At present the Administrative officers have to manage the records of the every students of this college manually on paper . They have to search from a large number of various files ,the required file of the student. This project will solve this problem and is capable of following: Maintaining the data of students Maintaining sessional details of students, Searching students on the basis of Roll no ,or name , Collect records of various branches and semester.

SMS Student Management System software will automate the operations of the Administrative office of the college.

PROJECT ANALYSIS
A complete understanding of the software requirements is necessary for successful software. It is therefore the Requirements analysis is done. The Requirement analysis is a process of understanding of user requirements, study of existing system, disadvantage of existing system, objectives of proposed system, and the various constraints that are to be applied to proposed system. Requirement analysis is software engineering task that bridges the gap between user specification and software design. Users Requirements are taken as a written document and verified at the same time. This makes sure that the software Engineer properly understands the problem. Both the developer and the customer take an active role in the requirement analysis. The customer tries to put into words, his requirements from the software and the developer acts as an interrogator, consultant and a problem solver. It enables a S/W Engineer to specify software functions and performance, indicate softwares interface with other system elements and establish constraints that the software must meet. This phase must achieve three primary objectives: (i) To describe the customer Requirements (ii) To establish the basis for the creation of the software (iii)To define the set of requirements

Requirement Analysis of SMS


Before the start of the process following analysis was done for the system

What is the system aimed for?


SMS Student Management System software will automate the operations of the Administrative office of the college. Main operations of the Administrative office are: Maintaining the data of students, maintaining sessional details of students, Searching students on the basis of roll no, or name, Collect records of various branches and semester.

SRS for Student Management System: Module: 1 (Basic Details Entry Process)
In this process, the software will ask for the basic details of students. It will ask name, roll number, fathers name, and date of birth, address, semester, & branch.

Module: 2 (View, Update, & deletion of Basic Details)


The software manages data of students. It asks student roll number, semester and branch. The software then provides a view to the basic Details of the student. In this module, a user can update data and can delete data.

Module: 3 (Sessionals Entry Process)


In this process, data of students regarding their sessional held in DB whose Roll no in Basic detail Table. It will ask roll number, semester, branch, & marks of all students.

Module: 4 (view, update, & deletion of sessionals)


The software manages sessionals of students. It asks student roll number, semester and branch. The software then provides a view to the Sessional of the student. In this module, a user can update data and can delete data.

PROJECT REQUIREMENT SPECIFICATION

Requirement specifies capabilities that system must provide in order to solve the problem. Requirement includes functional requirement of hardware, software and user interface. The system must be able to integrate the following facilities. Interactive menus for selecting operation to be performed. The record must have all the essential fields, roll number, name etc.

ENVIRONMENTAL REQUIREMENTS

HARDWARE REQUIREMENTS
1. PC-Pentium III or above 2. 128 MB RAM 3. 10 GB Hard Disk

SOFTWARE REQUIREMENTS
1. JDK 1.6 2. JDBC/ODBC 3. MS-ACCESS

3. PERFORMANCE REQUIREMENTS
The performance requirements of the system are that it should have fast response and correct retrieval of information. The language used should be very easy and clear to understand for the user or the operator for feeding the data or the records etc. The main memory should be large enough to handle large data and store it well. The system should maintain the complete integrity.

SYSTEM ACCEPTANCE CRITERIA


The system should be able to create data files, retrieve, update and format by information form the system file. It should be able to recognize invalid entries and corresponding error message should be generated. The system must be able to perform all the function viz. maintenance of master files, temporary files, calculating data, able to handle and process the data, should generate the necessary reports etc. While performing these above functions the data integrity must be maintained. It should have the space for storage of the full records and the data.

Project Design
Software design is the process of applying various techniques and principles for the purpose of the designing a system in sufficient details to present its physical relation. The software is built in three stages:1. External Design 2. Architectural Design 3. Detailed Design External design in software involves conceiving, planning out and specifying the external observable characteristics of a software product. These characteristics include user display and report format, external data sources and sinks and functional characteristics, performance requirement and high level process structure for the product. In other words we can say that external design is the transitional step form the requirement definition. Architectural design is concerned with refining the conceptual view of the system, identifying internal processing functions decomposing higher level functions into sub functions, defining external data streams and data structures and establishing relationships and interconnections among functions. Detailed design includes specification of algorithms that implements the functions, concrete data structures that implements the data structure, the actual interconnections among functions data structures and packing schemes for the system.

1. External Design
External Design consideration is to perform the employee details through the unique field i.e. the employee code, perform salary processing. Filling of all the forms should be automatic i.e. viz. either diagrams or flow charts, algorithms.

2. Architectural Design
In architectural design, describe the structure of a system. There are standard design representation techniques such a data flow diagrams structure charts, algorithms.

Dataflow Diagram

Student Database

Input From User


Username & password

Error Message
Unauthorized User

ODBC Calls Verify User

Login Module

DB Connection
Queries & Update to DB

Loads Main Form after Successful verification

Main Form

Modify Student info

Delete Student info

Add Student

DATABASE DESIGN
Table Structure Used in Student Management System

1. Studentinfo
Primary Key: rollno Description: This table is used to store basic details of students.

Field Name
Name Gender Father_name Date_of_birth Present Address Telephone no Course Sem

Field Type
Text Text Text Text Text Text Text Text

Size
50 50 50 50 50 50 50 50

Description
Name of student Sex of Student Fathers Name Date_of_birth Address of student Ph no of Student Stream of student semesters of B.Tech.

2.student
Primary Key: username Description: This table is used to store name & password of users.

Field Name
username Password

Field Type
Text Text

Size
50 50

Description
Name of user Password of user

Student Forms with some coding


Once, Designing is over, coding phase starts. Coding for Student Management System is given below: The System consists of the following files: Login.java DatabaseConnection.java

Coding:
import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; import javax.swing.table.*; public class Student extends JFrame { //Declaring Variables boolean inAnApplet = true; final boolean shouldFill = true; final boolean shouldWeightX = true; //Welcome panel TAB final static String panelstr0 = " Welcome "; //Login panel TAB final static String panelstr1 = " LOGIN ";

//Student Detail panel TAB final static String panelstr2 = " ADD STUDENT DETAILS "; //Modify or Delete Student Details panel TAB final static String panelstr3 = " MODIFY / DELETE STUDENT DETAILS "; //Applying courier new fonts for the controls used Font dFont = new Font("courier new",Font.PLAIN,12); Font tFont = new Font("courier new",Font.BOLD,14); //Applying listners for handling radio button events RadioListener alistener = new RadioListener(); //Applying listners for handling check box events CheckBoxListener ckblistener = new CheckBoxListener(); //Applying listners for handling combo box events ComboBoxListener cmblistener = new ComboBoxListener(); //Applying gridbag layout GridBagLayout grid = new GridBagLayout(); GridBagConstraints gbc1 = new GridBagConstraints(); GridBagConstraints gbc2 = new GridBagConstraints(); GridBagConstraints gbc3 = new GridBagConstraints(); //Dialog Box to ask delete confirmation messages Container cpane = getContentPane(); JDialog dlg = new JDialog((Frame) null, " Delete Confirmation!!!", true); Container dlgCPane = dlg.getContentPane(); //Grouping the Radio Buttons ButtonGroup bg1 = new ButtonGroup(); ButtonGroup bg2 = new ButtonGroup(); ButtonGroup bg3 = new ButtonGroup(); // Declaring the Labels JLabel jwelcome, jlogin, jpass, jstudentname, jpreaddress, jpermaaddress, jfathername, jgender, jcourse, jyear, jlabel, jdob, jfatheroccupation, jphone,jlabel111; JLabel jmstudentname, jmpreaddress, jmpermaaddress, jmfathername, jmgender, jmcourse, jmyear, jmlabel, jmdob, jmfatheroccupation, jmphone; JLabel jLabeldlg = new JLabel("Are you sure?"); // Declaring the Radio buttons JRadioButton male, female, m_male, m_female;

// Declaring the Check boxes JCheckBox dmc, degree, charcerti, ncc, mdmc, mdegree, mcharcerti, mncc; JCheckBox ckstudentID, ckstudentname, ckpreaddress, ckpermaaddress, ckfathername, ckgender, ckdob; // Declaring the combo boxes JComboBox cb_course, cb_year ,mcb_course, mcb_year, cb_sname, cb_fatheroccupation, mcb_fatheroccupation; JComboBox jstudID, jeq; // Declaring the text boxes JTextField tlogname, tsname, tspreaddress, tspermaaddress, tsphone, tsdob, tsfathername, tsfatheroccupation; JPasswordField tlogpass = new JPasswordField(40); JTextField tmname, tmpreaddress, tmpermaaddress, tmphone, tmdob, tmfathername, tmfatheroccupation; // Declaring the String type variables String driver="sun.jdbc.odbc.JdbcOdbcDriver"; String url="jdbc:odbc:student"; String title_dialog = "Student Record Added"; String fail_dialog = "Login Error"; String add_dialog = "Database Record Added"; String modify_dialog = "Database Record Updated"; String del_dialog = "Database Record Deleted"; String gender = "male"; String year = "I Year"; String course = "BSc(Comp. Sc.)"; String foccupation = "Govt. Employee"; String currentname = ""; String tempname = ""; String qry = ""; String condsel="No Condition", studID="StudentID", eq="="; String query1, query2, query3, query4, query5, query6, query7, message_dialog, nsel, selname, reg_no,str; //Declaring the Integer type variables int dmcsel, degreesel, charcfsel, ncccfsel, mdmcsel, mdegreesel, mcharcfsel, mnccsel; int type_dialog = JOptionPane.PLAIN_MESSAGE; int ctr_val=0,selstudentID=0,selstudentname=0,selstudentpreadd=0, selstudentpermaadd, selfathername=0,selgender=0, seldob=0; //Declaring the JPanel & Tabbed panes JPanel pan0, pan1, pan2, pan3; JTabbedPane tbPane = new JTabbedPane();

// Declaring the Submit Buttons JButton delit = new JButton("YES"); JButton delno = new JButton("NO"); JButton login, cont, save, mod_button, del; //Building JTable for student reports Object[] data = new Object[5]; DefaultTableModel defaulttablemodel = new DefaultTableModel(); JTable jtable = new JTable(defaulttablemodel); //Starting with the main() method public static void main(String args[]) { Student stud = new Student(); } //------------------------- Ending with the main() method ----------------//========================= Starting with the Student constructor ========= public Student() { // Declaring title for the application super("STUDENT INFORMATION MANAGEMENT SYSTEM"); setUp(); pack(); addWindowListener(new WindowEventHandler()); setSize(640,480); show(); } //--------------------------Ending with the Student Constructor-------------//Starting the setUp() method to create the File menu on panel void setUp() { setUpMenuBar(); //Calling the setUpMenuBar() to create the Exit Menu item displayPanel0(); the Exit menu item cpane.add(tbPane, BorderLayout.CENTER); } //------------Ending with the setUp() method--------//-----------Starting with the setUpMenuBar() method to create File menu void setUpMenuBar() //Calling a method that creates a panel and displays

{ MenuBar mBar = new MenuBar(); Menu mfile = new Menu("File"); // Creating the Exit menu item MenuItem xfile = new MenuItem("Exit"); // Handling this menu item on click event to Exit xfile.addActionListener(new MenuItemHandler()); mfile.add(xfile); mBar.add(mfile); setMenuBar(mBar); } //--------------------------Ending with the setUpMenuBar() method-------------//-----------Starting with the displayPanel0() method to create the Welcome panel void displayPanel0() { pan0 = new JPanel(); //Creating a Welcome Panel pan0.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"")); pan0.setFont(tFont); pan0.setLayout(grid); jwelcome = new JLabel("Student Information Management System "); Font f = new Font("Helvetica", Font.BOLD + Font.ITALIC, 30); jwelcome.setFont(f); gbc1.ipady=1; gbc1.ipadx=1; gbc1.gridx=0; gbc1.gridy=1; grid.setConstraints(jwelcome,gbc1); pan0.add(jwelcome); jlabel111=new JLabel(" gbc1.ipady=1; gbc1.ipadx=1; gbc1.gridx=0; gbc1.gridy=2; grid.setConstraints(jlabel111,gbc1); pan0.add(jlabel111); cont = new JButton("Click to Continue"); gbc1.ipady = 1; gbc1.ipadx = 1; ");

gbc1.gridx = 0; gbc1.gridy = 3; grid.setConstraints(cont, gbc1); pan0.add(cont); cont.addActionListener(new ButtonHandler()); tbPane.addTab(panelstr0, pan0); } //--------------------------Ending with the displayPanel0() method-------------//-----------Starting with the displayPanel1() method to create the Login panel void displayPanel1() { pan1 = new JPanel(); //LOGIN TAB pan1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"")); pan1.setFont(tFont); pan1.setLayout(grid); jlogin = new JLabel("Login Name "); jlogin.setFont(dFont);// Make this Data Font that we declared before //gbc1.weightx = 0.0; //Horizontal Space not required here gbc1.weighty = 0.0; //Vertical Space gbc1.ipady = 2; //Height of Component gbc1.ipadx = 2; //Width of Component gbc1.anchor = GridBagConstraints.WEST; gbc1.gridwidth = 1; //1 columns wide gbc1.gridx = 0; //aligned with login 0 -- Very Important gbc1.gridy = 0; //0th Row // Adding all these features to this Label, jlogin grid.setConstraints(jlogin, gbc1); // Adding the Label "jlogin" onto the LOGIN TAB pan1.add(jlogin); tlogname = new JTextField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.weighty = 0.0; gbc1.anchor = GridBagConstraints.WEST; gbc1.gridwidth = 5; gbc1.gridx = 1;

gbc1.gridy = 0; grid.setConstraints(tlogname, gbc1); pan1.add(tlogname); jpass = new JLabel("Password"); jpass.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.weighty = 0.0; gbc1.anchor = GridBagConstraints.WEST; gbc1.gridwidth = 5; gbc1.gridx = 0; gbc1.gridy = 1; grid.setConstraints(jpass, gbc1); pan1.add(jpass); tlogpass = new JPasswordField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.weighty = 0.0; gbc1.anchor = GridBagConstraints.WEST; gbc1.gridwidth = 2; gbc1.gridx = 1; gbc1.gridy = 1; grid.setConstraints(tlogpass, gbc1); pan1.add(tlogpass); login = new JButton("LOGIN"); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.weighty = 0.0; gbc1.anchor = GridBagConstraints.CENTER; gbc1.gridwidth = 1; gbc1.gridx = 1; gbc1.gridy = 2; grid.setConstraints(login, gbc1); pan1.add(login); login.addActionListener(new ButtonHandler()); tbPane.addTab(panelstr1, pan1); } //------------------------------------------------------------ Ending with displayPanel1() method ----------//========================================================= === Starting with displayPanel2() method =========== void displayPanel2() //ADD STUDENT DETAILS TAB { pan2 = new JPanel();

pan2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"")); pan2.setLayout(grid); jstudentname = new JLabel("Student Name"); jstudentname.setFont(dFont); gbc1.fill = GridBagConstraints.BOTH; gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 1; grid.setConstraints(jstudentname, gbc1); pan2.add(jstudentname); tsname = new JTextField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 1; grid.setConstraints(tsname, gbc1); pan2.add(tsname); jdob = new JLabel("Date of Birth"); jdob.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 2; grid.setConstraints(jdob, gbc1); pan2.add(jdob); tsdob = new JTextField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 2; grid.setConstraints(tsdob, gbc1); pan2.add(tsdob); jfathername = new JLabel("Father Name");

jfathername.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 3; grid.setConstraints(jfathername, gbc1); pan2.add(jfathername); tsfathername = new JTextField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 3; grid.setConstraints(tsfathername, gbc1); pan2.add(tsfathername); jfatheroccupation = new JLabel("Father Occupation"); jfatheroccupation.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 4; grid.setConstraints(jfatheroccupation, gbc1); pan2.add(jfatheroccupation); cb_fatheroccupation = new JComboBox(); cb_fatheroccupation.setFont(dFont); // Adding Elements to combo box cb_fatheroccupation.addItem(" Govt. Employee "); cb_fatheroccupation.addItem(" Self Employed "); cb_fatheroccupation.addItem(" Business "); gbc1.fill = GridBagConstraints.BOTH; gbc1.insets = new Insets(10,0,0,30); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 4; cb_fatheroccupation.addItemListener(new ComboBoxListener()); grid.setConstraints(cb_fatheroccupation, gbc1); pan2.add(cb_fatheroccupation); jpreaddress = new JLabel("Present Address"); jpreaddress.setFont(dFont);

gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 5; grid.setConstraints(jpreaddress, gbc1); pan2.add(jpreaddress); tspreaddress = new JTextField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 5; grid.setConstraints(tspreaddress, gbc1); pan2.add(tspreaddress); jpermaaddress = new JLabel("Permanent Address"); jpermaaddress.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 6; grid.setConstraints(jpermaaddress, gbc1); pan2.add(jpermaaddress); tspermaaddress = new JTextField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 6; grid.setConstraints(tspermaaddress, gbc1); pan2.add(tspermaaddress); jphone = new JLabel(" Telephone Number "); jphone.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 7; grid.setConstraints(jphone, gbc1);

pan2.add(jphone); tsphone = new JTextField(20); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 7; grid.setConstraints(tsphone, gbc1); pan2.add(tsphone); // Checking the default gender as male by using 'true' jgender = new JLabel("Gender"); jgender.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 8; grid.setConstraints(jgender, gbc1); pan2.add(jgender); male = new JRadioButton("Male",true); male.setFont(dFont); gbc1.fill = GridBagConstraints.BOTH; gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 8; grid.setConstraints(male, gbc1); male.addActionListener(new RadioListener()); bg1.add(male); pan2.add(male); female = new JRadioButton("Female",false); female.setFont(dFont); gbc1.fill = GridBagConstraints.BOTH; gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 2; gbc1.gridy = 8; grid.setConstraints(female, gbc1); female.addActionListener(new RadioListener()); bg1.add(female); pan2.add(female);

jcourse = new JLabel(" Course "); jcourse.setFont(dFont); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 0; gbc1.gridy = 9; grid.setConstraints(jcourse, gbc1); pan2.add(jcourse); cb_course = new JComboBox(); // Applying Fonts inside the combo box as courier new cb_course.setFont(dFont); // Adding the elements to combo box cb_course.addItem("BSc(Comp.Sc.)"); cb_course.addItem("BCA"); // Filling it align properly with other Elements inside the TAB gbc1.fill = GridBagConstraints.BOTH; gbc1.insets = new Insets(10,0,0,30); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 1; gbc1.gridy = 9; cb_course.addItemListener(new ComboBoxListener()); grid.setConstraints(cb_course, gbc1); pan2.add(cb_course); cb_year = new JComboBox(); cb_year.setFont(dFont); // Adding the combo box elements to combo box cb_year.addItem(" I Year "); cb_year.addItem(" II Year "); cb_year.addItem(" III Year "); gbc1.fill = GridBagConstraints.BOTH; gbc1.insets = new Insets(10,0,0,30); gbc1.ipady = 2; gbc1.ipadx = 2; gbc1.gridx = 2; gbc1.gridy = 9; cb_year.addItemListener(new ComboBoxListener()); grid.setConstraints(cb_year, gbc1);

pan2.add(cb_year); dmc = new JCheckBox("Detail Mark Sheet Given"); //Using check boxes gbc1.fill = GridBagConstraints.BOTH; gbc1.ipady = 0; gbc1.ipadx = 0; gbc1.gridx = 1; gbc1.gridy = 10; grid.setConstraints(dmc, gbc1); dmc.setFont(dFont); dmc.addItemListener(new CheckBoxListener()); pan2.add(dmc); degree = new JCheckBox("Degree Awarded"); gbc1.ipady = 0; gbc1.ipadx = 0; gbc1.gridx = 2; gbc1.gridy = 10; grid.setConstraints(degree, gbc1); degree.setFont(dFont); degree.addItemListener(new CheckBoxListener()); pan2.add(degree); charcerti = new JCheckBox("Character Certificate Given "); gbc1.ipady = 0; gbc1.ipadx = 0; gbc1.gridx = 1; gbc1.gridy = 11; grid.setConstraints(charcerti, gbc1); charcerti.setFont(dFont); charcerti.addItemListener(new CheckBoxListener()); pan2.add(charcerti); ncc = new JCheckBox("NCC Certificate Given"); gbc1.ipady = 0; gbc1.ipadx = 0; gbc1.gridx = 2; gbc1.gridy = 11;

grid.setConstraints(ncc, gbc1); ncc.setFont(dFont); ncc.addItemListener(new CheckBoxListener()); pan2.add(ncc); save = new JButton("SAVE RECORD"); gbc1.ipady = 1; gbc1.ipadx = 2; gbc1.gridx = 2; gbc1.gridy = 12; grid.setConstraints(save, gbc1); // Handling the SAVERECORD button on click event by ButtonHandler() class save.addActionListener(new ButtonHandler()); pan2.add(save); tbPane.addTab(panelstr2,pan2); } //-------------------------------------------------------------- Ending with displayPanel2() method --------//========================================================= === Starting displayPanel3() method ========= void displayPanel3() //MODIFY/DELETE STUDENT DETAILS TAB { pan3 = new JPanel(); pan3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"")); pan3.setLayout(grid); cb_sname = new JComboBox(); cb_sname.addItem("Select Student Name"); cb_sname.setFont(dFont); gbc2.fill = GridBagConstraints.BOTH; gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 2; gbc2.gridy = 1; grid.setConstraints(cb_sname, gbc2); cb_sname.addItemListener(new ComboBoxListener()); pan3.add(cb_sname); jmstudentname = new JLabel("Student Name"); jmstudentname.setFont(dFont);

gbc2.fill = GridBagConstraints.BOTH; gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 0; gbc2.gridy = 2; grid.setConstraints(jmstudentname, gbc2); pan3.add(jmstudentname); tmname = new JTextField(20); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 2; grid.setConstraints(tmname, gbc2); pan3.add(tmname); jmdob = new JLabel("Date of Birth "); jmdob.setFont(dFont); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 0; gbc2.gridy = 3; grid.setConstraints(jmdob, gbc2); pan3.add(jmdob); tmdob = new JTextField(20); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 3; grid.setConstraints(tmdob, gbc2); pan3.add(tmdob); jmfathername = new JLabel("Father's Name"); jmfathername.setFont(dFont); gbc2.ipady = 2; gbc2.ipadx = 2;

gbc2.gridx = 0; gbc2.gridy = 4; grid.setConstraints(jmfathername, gbc2); pan3.add(jmfathername); tmfathername = new JTextField(20); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 4; grid.setConstraints(tmfathername, gbc2); pan3.add(tmfathername); jmfatheroccupation = new JLabel("Father's Occupation"); jmfatheroccupation.setFont(dFont); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 0; gbc2.gridy = 5; grid.setConstraints(jmfatheroccupation, gbc2); pan3.add(jmfatheroccupation); mcb_fatheroccupation = new JComboBox(); mcb_fatheroccupation.setFont(dFont); // Adding the combo box elements to combo box mcb_fatheroccupation.addItem(" Govt. Employee "); mcb_fatheroccupation.addItem(" Self Employed "); mcb_fatheroccupation.addItem(" Business "); gbc2.fill = GridBagConstraints.BOTH; gbc2.insets = new Insets(10,0,0,30); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 5; mcb_fatheroccupation.addItemListener(new ComboBoxListener()); grid.setConstraints(mcb_fatheroccupation, gbc2); pan3.add(mcb_fatheroccupation); jmpreaddress = new JLabel("Present Address"); jmpreaddress.setFont(dFont); gbc2.ipady = 2;

gbc2.ipadx = 2; gbc2.gridx = 0; gbc2.gridy = 6; grid.setConstraints(jmpreaddress, gbc2); pan3.add(jmpreaddress); tmpreaddress = new JTextField(20); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 6; grid.setConstraints(tmpreaddress, gbc2); pan3.add(tmpreaddress); JLabel jmpermaaddress = new JLabel("Permanent Address "); jmpermaaddress.setFont(dFont); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 0; gbc2.gridy = 7; grid.setConstraints(jmpermaaddress, gbc2); pan3.add(jmpermaaddress); tmpermaaddress = new JTextField(20); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 7; grid.setConstraints(tmpermaaddress, gbc2); pan3.add(tmpermaaddress); jmphone = new JLabel(" Telephone Number "); jmphone.setFont(dFont); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 0;

gbc2.gridy = 8; grid.setConstraints(jmphone, gbc2); pan3.add(jmphone); tmphone = new JTextField(20); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 8; grid.setConstraints(tmphone, gbc2); pan3.add(tmphone); // Checking the default gender as male by using true jmgender = new JLabel("Gender"); jmgender.setFont(dFont); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 0; gbc2.gridy = 9; grid.setConstraints(jmgender, gbc2); pan3.add(jmgender); m_male = new JRadioButton("Male",true); m_male.setFont(dFont); gbc2.fill = GridBagConstraints.BOTH; gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 9; grid.setConstraints(m_male, gbc2); m_male.addActionListener(alistener); bg2.add(m_male); pan3.add(m_male); m_female = new JRadioButton("Female",false); m_female.setFont(dFont); gbc2.fill = GridBagConstraints.BOTH; gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 2; gbc2.gridy = 9; grid.setConstraints(m_female, gbc2);

m_female.addActionListener(alistener); bg2.add(m_female); pan3.add(m_female); jmcourse = new JLabel(" Course "); jmcourse.setFont(dFont); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 0; gbc2.gridy = 10; grid.setConstraints(jmcourse, gbc2); pan3.add(jmcourse); mcb_course = new JComboBox(); mcb_course.setFont(dFont); // Adding the combo box elements to combo box mcb_course.addItem("BSc(Comp.Sc.)"); mcb_course.addItem("BCA"); // Fillig it to align properly with other Elements inside the TAB gbc2.fill = GridBagConstraints.BOTH; gbc2.insets = new Insets(10,0,0,30); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 10; mcb_course.addItemListener(new ComboBoxListener()); grid.setConstraints(mcb_course, gbc2); pan3.add(mcb_course); mcb_year = new JComboBox(); mcb_year.setFont(dFont); // Adding Elements to combo box mcb_year.addItem(" I Year "); mcb_year.addItem(" II Year "); mcb_year.addItem(" III Year "); gbc2.fill = GridBagConstraints.BOTH; gbc2.insets = new Insets(10,0,0,30); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 2; gbc2.gridy = 10; mcb_year.addItemListener(new ComboBoxListener());

grid.setConstraints(mcb_year, gbc2); pan3.add(mcb_year); mdmc = new JCheckBox("Detail Mark Sheet Given"); gbc2.fill = GridBagConstraints.BOTH; gbc2.ipady = 0; gbc2.ipadx = 0; gbc2.gridx = 1; gbc2.gridy = 11; grid.setConstraints(mdmc, gbc2); mdmc.setFont(dFont); mdmc.addItemListener(new CheckBoxListener()); pan3.add(mdmc); mdegree = new JCheckBox("Degree Awarded"); gbc2.ipady = 0; gbc2.ipadx = 0; gbc2.gridx = 2; gbc2.gridy = 11; grid.setConstraints(mdegree, gbc2); mdegree.setFont(dFont); mdegree.addItemListener(new CheckBoxListener()); pan3.add(mdegree); mcharcerti = new JCheckBox("Character Certificate Given "); gbc2.ipady = 0; gbc2.ipadx = 0; gbc2.gridx = 1; gbc2.gridy = 12; grid.setConstraints(mcharcerti, gbc2); mcharcerti.setFont(dFont); mcharcerti.addItemListener(new CheckBoxListener()); pan3.add(mcharcerti); mncc = new JCheckBox("NCC Certificate Given"); gbc2.ipady = 0; gbc2.ipadx = 0; gbc2.gridx = 2;

gbc2.gridy = 12; grid.setConstraints(mncc, gbc2); mncc.setFont(dFont); mncc.addItemListener(new CheckBoxListener()); pan3.add(mncc); del = new JButton("DELETE"); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 1; gbc2.gridy = 13; grid.setConstraints(del, gbc2); pan3.add(del); del.addActionListener(new ButtonHandler()); mod_button = new JButton("MODIFY"); gbc2.ipady = 2; gbc2.ipadx = 2; gbc2.gridx = 2; gbc2.gridy = 13; grid.setConstraints(mod_button, gbc2); pan3.add(mod_button); mod_button.addActionListener(new ButtonHandler()); tbPane.addTab(panelstr3, pan3); accessStudName(); } //-------------------------------------------------------------- Ending with displayPanel3() method --------//---------------------------------------------------------------Starting with displayPanes() method--------void displayPanes() // ACCOUNTANT LOGGEDIN { displayPanel2(); displayPanel3(); } //========================================================= = Starting with verifyLogin() ============= void verifyLogin() //Verifing Login for username 'administrator' and password 'password'

{ try { String val1 = tlogname.getText(); val1 = val1.trim(); String val2 = (String)tlogpass.getText(); val2 = val2.trim(); //JDBC step 1 : Writing the query query1 = "SELECT * FROM login WHERE login='"+val1+"' AND passwd='"+val2+"'"; //JDBC step 2 : Registering the driver="sun.jdbc.odbc.JdbcOdbcDriver"; for MSACCESS Class.forName(driver); //JDBC step 3 : Using the driver="sun.jdbc.odbc.JdbcOdbcDriver"; Connection con=DriverManager.getConnection("jdbc:odbc:student"); //JDBC step 4 : Creating a statement Statement st = con.createStatement(); //JDBC step 5 : Exceuting the query boolean bresults = st.execute(query1); //JDBC step 6 : Checking the results if(bresults) { ResultSet result = st.getResultSet(); //JDBC step 7 : if there are results retrieve the SET if(result!=null) { //Calling the method "showResults(ResultSet r)" and pass ResultSet to it showResults(result); } else { } //JDBC step 8 : Closing the database connection //con.close(); } } catch(SQLException ex) { System.out.println("Unable to access the database"); } catch(ClassNotFoundException ex) { System.out.println("Class not found");

} catch(Exception ex) { System.out.println("Exception raised is:"+ex); } } //--------------------------------------------Ending with verifyLogin() method------//--------------------------------------------Starting with showResults() method-----void showResults(ResultSet r) throws SQLException { ResultSetMetaData rmeta = r.getMetaData(); //Retrieving the Metadata from the resultset int frecord = 0; int nCols=rmeta.getColumnCount(); if(r.next()) { // Retrieving the first field from the login table of the student.mdb database String param1 = r.getString(1).trim(); String param2 = r.getString(2).trim(); if (param1.equals("administrator") && param2.equals("password")) { // Verifying for login "administrator" and password 'password' // if found record, then set frecord = 1 frecord = 1; //removing Login TAB tbPane.removeTabAt(0); // Displaying other panes displayPanes(); } /*String param2 = r.getString(2).trim(); if (param2.equals("password")) { // Verifying for login "administrator" and password 'password' // if found record, then set frecord = 1 frecord = 1; //removing Login TAB tbPane.removeTabAt(0); // Displaying other panes displayPanes(); } */ else if(frecord==0)

{ //if frecord is zero, then display invalid login. message_dialog = "Invalid Login name/password. Please enter again. "; type_dialog = JOptionPane.INFORMATION_MESSAGE; //Disaplaying the alert message JOptionPane.showMessageDialog((Component) null, message_dialog, fail_dialog, type_dialog); //Creating the tlogname and tlogpass textboxes empty tlogname.setText(" "); tlogpass.setText(" "); } } else { message_dialog = "Invalid Login. Please Enter Again."; type_dialog = JOptionPane.INFORMATION_MESSAGE; JOptionPane.showMessageDialog((Component) null, message_dialog, fail_dialog, type_dialog); tlogname.setText(" "); tlogpass.setText(" "); } } //------------------------------------------------------------------- Ending with showResults() method ------//========================================================= ========== Starting with addRecord() method==== void addRecord() { try { Class.forName(driver); Connection con=DriverManager.getConnection(url); Statement st = con.createStatement(); //Generating new register number String query2 = "SELECT * FROM student_details"; ResultSet rs = st.executeQuery(query2); int cnt = 0; while (rs.next()) { cnt++;

} cnt = cnt+1; String cs = (String)course.substring(0,3); char ss = year.charAt(0); reg_no = ""+cs+""+ss+"-"+cnt; query3 = "INSERT INTO student_details (name,preaddress,permaaddress,fathername,dateofbirth,fatheroccupation,phone,gender,year,cour se,dmc,degree,charcerti,ncccerti) VALUES ('"+tsname.getText()+"','"+tspreaddress.getText() +"','"+tspermaaddress.getText()+"','"+tsfathername.getText()+"','"+tsdob.getText() +"','"+foccupation+"','"+tsphone.getText() +"','"+gender+"','"+year+"','"+course+"',"+dmcsel+","+degreesel+","+charcfsel+","+ncccfsel+")" ; int rs_int=st.executeUpdate(query3); con.close(); message_dialog = " "+tsname.getText().toUpperCase()+" Record is Added "; type_dialog = JOptionPane.INFORMATION_MESSAGE; JOptionPane.showMessageDialog((Component) null, message_dialog, add_dialog, type_dialog); // Adding the new record to the JTable String [] data=new String[7]; data[0] = reg_no; data[1] = tsname.getText(); data[2] = tspreaddress.getText(); data[3] = tspermaaddress.getText(); data[4] = tsphone.getText(); data[5] = tsfathername.getText(); data[6] = tsdob.getText(); defaulttablemodel.addRow(data); cb_fatheroccupation.setSelectedIndex(0); cb_course.setSelectedIndex(0); cb_year.setSelectedIndex(0); String snametemp = tsname.getText(); cb_sname.addItem(tsname.getText()); //Adding name to combobox in modify names TAB //Setting other textboxes as blank to enable new record entry tsname.setText(" "); tspreaddress.setText(" "); tsfathername.setText(" "); // Uncheck the checkboxes, if they are checked while adding data dmc.setSelected(false);

degree.setSelected(false); ncc.setSelected(false); charcerti.setSelected(false); //clicking the radiobutton male , to make it default again male.doClick(); } catch(SQLException ex) { System.out.println("Unable to access the database"); } catch(ClassNotFoundException ex) { System.out.println("Class not found"); } catch(Exception ex) { System.out.println("Exception raised is:"+ex); } } //------------------------------------------------------------------- Ending with addRecord() ------//========================================================= ====== Starting with accessModifiedDatabase() ======== void accessModifiedDatabase(int nsel) { try { query4 = "SELECT * FROM student_details WHERE registration_no="+nsel+""; Class.forName(driver); Connection con=DriverManager.getConnection(url); Statement st = con.createStatement(); boolean bresults = st.execute(query4); if(bresults) { ResultSet result = st.getResultSet(); if(result!=null) { showModifiedResults(result); } con.close(); } } catch(SQLException ex) {

System.out.println("Unable to access the database"); } catch(ClassNotFoundException ex) { System.out.println("Class not found"); } catch(Exception ex) { System.out.println("Exception raised is:"+ex); } } //------------------------------------------------------------------- Ending with accessModifiedDatabase() ------//========================================================= ====== Starting with showModifiedResults() ======== void showModifiedResults(ResultSet r) throws SQLException { ResultSetMetaData rmeta = r.getMetaData(); int frecord = 0; int nCols=rmeta.getColumnCount(); String txt1=""; String txt2=""; String txt3=""; String txt4=""; String txt5=""; String txt6=""; String txt7=""; String txt8=""; String txt9=""; String txt10=""; String txt11=""; int int9=0; int int10=0; int int11=0; int int12=0; while(r.next()) { reg_no=r.getString(1); txt2+=r.getString(2); txt3+=r.getString(3); txt4+=r.getString(4); txt5+=r.getString(5); txt6+=r.getString(6); txt7+=r.getString(7); txt8+=r.getString(8);

txt9+=r.getString(9); txt10=r.getString(10); txt11=r.getString(11); int9=r.getInt(12); int10=r.getInt(13); int11=r.getInt(14); int12=r.getInt(15); } currentname = txt2; tmname.setText(txt2); tmpreaddress.setText(txt3); tmpermaaddress.setText(txt4); tmphone.setText(txt8); tmfathername.setText(txt5); tmdob.setText(txt6); txt7 = txt7.trim(); if (txt7.equals("Govt. Employee ")) { mcb_fatheroccupation.setSelectedIndex(0); } else if(txt7.equals("Self Employed")) { mcb_fatheroccupation.setSelectedIndex(1); } else { mcb_fatheroccupation.setSelectedIndex(2); } txt9 = txt9.trim(); if (txt9.equalsIgnoreCase("M")) { m_male.doClick(); } else { m_female.doClick(); } txt11 = txt11.trim(); if (txt11.equals("B.Sc.(Comp. Sc.)")) { mcb_course.setSelectedIndex(1); } else { mcb_course.setSelectedIndex(0);

} txt10 = txt10.trim(); if (txt10.equals("I Year")) { mcb_year.setSelectedIndex(0); } else if(txt10.equals("II Year")) { mcb_year.setSelectedIndex(1); } else { mcb_year.setSelectedIndex(2); } if(int9==1) { mdmc.setSelected(true); } else { mdmc.setSelected(false); } if(int10==1) { mdegree.setSelected(true); } else { mdegree.setSelected(false); } if(int11==1) { mcharcerti.setSelected(true); } else { mcharcerti.setSelected(false); } if(int12==1) { mncc.setSelected(true); } else { mncc.setSelected(false); }

} //------------------------------------------------------------------- Ending with showModifiedResults() ------//========================================================= ====== Starting with accessStudName() ======== void accessStudName() //Retrieving the student list in the combo box { try { query5 = "SELECT registration_no,Name FROM student_details ORDER BY registration_no"; Class.forName(driver); Connection con=DriverManager.getConnection(url); Statement st = con.createStatement(); boolean bresults = st.execute(query5); if(bresults) { ResultSet result = st.getResultSet(); if(result!=null) { showStudName(result); } con.close(); } } catch(SQLException ex) { System.out.println("Unable to access the database"); } catch(ClassNotFoundException ex) { System.out.println("Class not found"); } catch(Exception ex) { System.out.println("Exception raised is:"+ex); } } //------------------------------------------------------------------- Ending with accessStudName() ------//========================================================= ====== Starting with showStudName() ======== void showStudName(ResultSet r) throws SQLException

{ ResultSetMetaData rmeta = r.getMetaData(); int nCols=rmeta.getColumnCount(); while(r.next()) { cb_sname.addItem(r.getString(1)+":"+r.getString(2)); ctr_val++; } } //------------------------------------------------------------------- Ending with showStudName() ------//========================================================= ====== Starting with deleteRecord() ======== void deleteRecord(int nsel) //Deleting the record for the selected student name { try { Class.forName(driver); Connection con=DriverManager.getConnection(url); Statement st = con.createStatement(); System.out.println("Delete name is :=="+nsel); query6 = "DELETE FROM student_details WHERE registration_no="+nsel; st.executeUpdate(query6); con.close(); mcb_course.setSelectedIndex(0); mcb_year.setSelectedIndex(0); tmname.setText(" "); tmdob.setText(" "); tmpreaddress.setText(" "); tmpermaaddress.setText(" "); tmfathername.setText(" "); tmphone.setText(" "); mdmc.setSelected(false); mdegree.setSelected(false); mncc.setSelected(false); mcharcerti.setSelected(false); m_male.doClick(); } catch(SQLException ex) { System.out.println("Unable to access the database"); } catch(ClassNotFoundException ex) {

System.out.println("Class not found"); } catch(Exception ex) { System.out.println("Exception raised is:"+ex); } } //------------------------------------------------------------------- Ending with deleteRecord() ------//========================================================= ====== Starting with updateRecord() ======== void updateRecord(int std_id,String str_name) //Update Database when modified { try { query7 = "UPDATE student_details SET name='"+tmname.getText()+"', preaddress='"+tmpreaddress.getText()+"', permaaddress='"+tmpermaaddress.getText()+"', fathername='"+tmfathername.getText()+"', dateofbirth='"+tmdob.getText()+"', fatheroccupation='"+foccupation+"', phone='"+tmphone.getText()+"', gender='"+gender+"', year='"+year+"', course='"+course+"', dmc="+dmcsel+", degree="+degreesel+", charcerti="+charcfsel+", ncccerti="+ncccfsel+" WHERE registration_no="+std_id; Class.forName(driver); Connection con=DriverManager.getConnection(url); Statement st = con.createStatement(); System.out.println(query7); int ret=st.executeUpdate(query7); System.out.println("Output is "+ret); con.close(); System.out.println("Called After"+str_name); message_dialog = " "+tmname.getText().toUpperCase()+" Record is Updated "; type_dialog = JOptionPane.INFORMATION_MESSAGE; JOptionPane.showMessageDialog((Component) null, message_dialog, modify_dialog, type_dialog); } catch(SQLException ex) { System.out.println("Unable to access the database"); } catch(ClassNotFoundException ex) { System.out.println("Class not found"); } catch(Exception ex)

{ System.out.println("Exception raised is:"+ex); } } //------------------------------------------------------------------- Ending with deleteRecord() ------//============================================================== = Starting with ButtonHandler class ======== class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent ev) { String s=ev.getActionCommand(); if(s.equals("Click to Continue")) { cont.setEnabled(false); displayPanel1(); tbPane.setSelectedIndex(1); tbPane.removeTabAt(0); } else if(s=="LOGIN") //Login is Clicked { verifyLogin(); tbPane.setSelectedIndex(0); tlogname.setText(""); } else if(s.equals("SAVE RECORD")) //Save Record is Clicked { addRecord(); String snametemp = tsname.getText(); } else if(s.equals("MODIFY")) //Modify Record is Clicked { int student_id=Integer.parseInt(selname.substring(0,2)); updateRecord(student_id,selname); int x=ctr_val; for(int y=x;y>1;y--) { cb_sname.removeItemAt(y); }

cb_sname.addItem("Select Student Name"); cb_sname.removeItemAt(0); cb_sname.removeItemAt(1); accessStudName(); cb_sname.removeItemAt(1); } else if(s.equals("DELETE")) //Delete Record Button is Clicked { dlgCPane.setLayout(new FlowLayout()); dlgCPane.add(jLabeldlg); jLabeldlg.setFont(tFont); dlgCPane.add(delit); delit.addActionListener(new ButtonHandler()); dlgCPane.add(delno); delno.addActionListener(new ButtonHandler()); dlg.setBounds(300, 200, 250, 120); dlg.show(); } else if(s.equals("YES")) dialog box { dlg.dispose(); selname = cb_sname.getSelectedItem().toString(); int student_id=Integer.parseInt(selname.substring(0,2)); deleteRecord(student_id); int x=ctr_val; for(int y=x;y>1;y--) { cb_sname.removeItemAt(y); } cb_sname.addItem("Select Student Name"); cb_sname.removeItemAt(0); cb_sname.removeItemAt(1); accessStudName(); cb_sname.removeItemAt(1); } else if(s.equals("NO")) Delete dialog box { dlg.dispose(); } } } //No button is clicked in the //Yes button is clicked in Delete

//------------------------------------------------------------- Ending with the ButtonHandler -------//========================================================= == Starting with the MenuItemHandler ====== class MenuItemHandler implements ActionListener { public void actionPerformed(ActionEvent ev) { String s=ev.getActionCommand(); if(s=="Exit") { //close window on menuitem exit System.exit(0); } } } //----------------------------------------------------------- Ending with the MenuItemHandler -----//========================================================= == Starting with the WindowEventHandler === class WindowEventHandler extends WindowAdapter { public void windowClosing(WindowEvent e) { //Closing the window on exit System.exit(0); } } //----------------------------------------------------------- Ending with WindowEventHandler --//========================================================= == Starting with RadioListener ======== class RadioListener implements ActionListener { public void actionPerformed(ActionEvent e) { gender = e.getActionCommand(); condsel = e.getActionCommand(); } } //----------------------------------------------------------- Ending with the RadioListener --------

//========================================================= == Starting with the ComboBoxListener ======== class ComboBoxListener implements ItemListener { public ComboBoxListener() { super(); } public void itemStateChanged(ItemEvent e) { str = (String)e.getItem(); if (e.getSource().equals(cb_fatheroccupation)) { foccupation = cb_fatheroccupation.getSelectedItem().toString(); } if (e.getSource().equals(mcb_fatheroccupation)) { foccupation = mcb_fatheroccupation.getSelectedItem().toString(); } if (e.getSource().equals(cb_course)) { course = cb_course.getSelectedItem().toString(); } if (e.getSource().equals(mcb_course)) { course = mcb_course.getSelectedItem().toString(); } if (e.getSource().equals(cb_year)) { year = cb_year.getSelectedItem().toString(); } if (e.getSource().equals(mcb_year)) { year = mcb_year.getSelectedItem().toString(); } if (e.getSource().equals(cb_sname)) { selname = cb_sname.getSelectedItem().toString(); accessModifiedDatabase(Integer.parseInt(selname.substring(0,2))); } if (e.getSource().equals(jstudID)) {

studID = jstudID.getSelectedItem().toString(); } if (e.getSource().equals(jeq)) { eq = jeq.getSelectedItem().toString(); } } } //----------------------------------------------------------- Ending with the ComboBoxListener -------//========================================================= == Starting with the CheckBoxListener ===== class CheckBoxListener implements ItemListener { public void itemStateChanged(ItemEvent e) { Object source = e.getItemSelectable(); if ((e.getStateChange() == ItemEvent.SELECTED) && (source==dmc)) { dmcsel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==dmc)) { dmcsel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==degree)) { degreesel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==degree)) { degreesel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ncc)) { ncccfsel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ncc))

{ ncccfsel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==charcerti)) { charcfsel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==charcerti)) { charcfsel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==mdmc)) { mdmcsel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==mdmc)) { mdmcsel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==mdegree)) { mdegreesel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==mdegree)) { mdegreesel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==mncc)) { mnccsel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==mncc)) { mnccsel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==mcharcerti)) {

mcharcfsel = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==mcharcerti)) { mcharcfsel = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ckstudentID)) { selstudentID = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ckstudentID)) { selstudentID = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ckstudentname)) { selstudentname = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ckstudentname)) { selstudentname = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ckpreaddress)) { selstudentpreadd = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ckpreaddress)) { selstudentpreadd = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ckpermaaddress)) { selstudentpermaadd = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ckpermaaddress)) { selstudentpermaadd = 0;

} if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ckfathername)) { selfathername = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ckfathername)) { selfathername = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ckgender)) { selgender = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ckgender)) { selgender = 0; } if ((e.getStateChange() == ItemEvent.SELECTED) && (source==ckdob)) { seldob = 1; } if ((e.getStateChange() == ItemEvent.DESELECTED) && (source==ckdob)) { seldob = 0; } }

PROJECT TESTING
Testing is the process of exercising software with the intent of finding and ultimately correcting the errors. Testing demonstrates that software functions appear to be working according to specification, that performance requirements appear to have been met. Data collected as testing is conducted provide a good indication of software reliability and some indication of software reliability and some indication of software quality as a whole.

Testing objectives:
Testing is process of executing a program with the intent of finding an error. A good test case is one of that has high probability of finding a yet undiscovered error. A successful test is the one that uncovers a yet undiscovered error.

Type of Testing:
White Box Testing: White Box Testing is a test case design that uses the control structure of the procedural design to derive test cases. White Box Testing basically looks for: (a) Logical Errors (b) Loop Testing (c) Typographical Errors (d) Testing of all independent paths (e) Tests all the internal data structure (f) Condition Testing White Box Testing is done on individual modules as well as the complete program. Black Box Testing: The basic objective of the Black Box Testing is to check the functional requirements of the system. Black Box Testing is done to find test cases. The tests done proved to be satisfactory after a few minor changes. The database updating,

deletion, modifications were perfect. The validation and checks were put in every page to prevent user from entering wrong data.

Testing methods:
Software testing states a number of methods to ensure complete testing, which are: Unit testing: The developer according to the design tests each individual function/program individually. This is done before the function is released for final Integration and System testing. It is the responsibility of the individual developer to ensure that the individual units are working as per the requirements. Selected processing components are unit tested- Selection Data module was having an error in selecting eligible students for a drive. There was a problem in the query used for that purpose. Integration testing: The integrated system is tested against the Test Scripts and functional specification. The project team is involved in testing the integrated software. System testing: Once the final integration testing is over all the known faults are fixed, the application is tested on the basis of the Test Scripts and Functional Specification. The project team is involved in system testing. The application is implemented in a variety of different environmental Configurations and is tested for compatibility with each configuration.

Test Strategies:
Test cases are designed with the intent of finding errors in the way the system will process it. There are two general strategies for testing software. They are: Code Testing: The code testing strategy examines the logic of the program. To follow this testing method, the analyst develops test cases that result in executing every instruction in the program or module; i.e. every path through the program is tested. A path is a specific combination of conditions that is handled by the program.

On the surface, code testing seems to be an ideal method for testing software. This testing strategy does not indicate whether all aspects are even implemented. Code testing also does not check the range of the data that the program will accept, even though, when software failures in actual case, it is frequently because users submitted data out of expected ranges. Specification Testing: To perform specification testing, specification is examined stating what the program should do and how it should perform under various conditions. Then test cases are developed for each condition or combination of conditions and submitted for processing. By examining the results, we can determine whether the program performs according to its specified requirements.

MAINTENANCE
This phase start when software system is released for production work and it continue during all the lifetime. It is the largest and the most important phase. Maintenance activities include: Enhancement of capabilities Error correction Deletion of obsolete features

We have three types of maintenance:

Preventive
For the software to prevent from any type of technological or requirement change, we will work on the project after its submission to TPO cell.

Corrective
The coding is implemented again and again to check the faults and it is checked at different levels.

Adaptive
JAVA can adapt itself to any operating system environment. So there is no need for this type of maintenance scheme.

PROJECT SECURITY
Security is concerned with making sure that unauthorized people cannot access the software. Even no one can change the entered information of students. Security requirements are particularly significantly in many database systems. Security requirements lace restrictions on the use of certain commands, control access to data, provide different kinds of access requirements for different people, require the use of password.

We have provided a login facility which asks for user name and password. We have given all the authority to a user but in future enhancements; we are planning to make to classes of users.

PROJECT IMPLEMENTATION
In this phase, the system or system modifications are installed and made operational in a production environment. The phase is initiated after the system has been tested and accepted by the user and Project Manager. Activities in this phase include notification of implementation to end users, execution of the previously defined training plan, data entry or conversion, and post implementation review. This phase continues until the system is operating in production in accordance with the defined user requirements. The new system can fall into three categories, replacement of a manual process, replacement of a legacy system, or upgrade to an existing system. Regardless of the type of system, all aspects of the implementation phase should be followed.

Steps of Implementation:

Notify users of new implementation: The implementation notice should be sent to all users and organizations affected by the implementation. Additionally, it is good policy to make internal organizations not directly affected by the implementation aware of the schedule so that allowances can be made for a disruption in the normal activities of that section.

Execute training plan: It is always a good business practice to provide training before the end user uses the new system. Because there has been a previously designed training plan established, complete with the system user manual, the execution of the plan should be relatively simple.

Perform data entry or conversion: With the implementation of any system, typically there is old data which is to be included in the new system. This data can be in a manual or an automated form. Regardless of the format of the data, the tasks in this section are two fold, data input and data verification. When replacing a manual system, hard copy data will need to be entered into the automated system. Some sort of verification that the data is being entered correctly should be conducted throughout

this process. This is also the case in data transfer, where data fields in the old system may have been entered inconsistently and therefore affect the integrity of the new database. Verification of the old data becomes imperative to a useful computer system. the operation can proceed on the old system while the bugs are worked out. Install System: To ensure that the system is fully operational, install the system in a production environment. Conduct post-implementation review: After the system has been fielded a postimplementation review is conducted to determine the success of the project through its implementation phase. The purpose of this review is to document implementation experiences to recommend system enhancements and provide guidance for future projects. In addition, change implementation notices will be utilized to document user requests for fixes to problems that may have been recognized during this phase. It is important to document any user request for a change to a system to limit misunderstandings between the end user and the system programmers. After the Implementation Phase Review and Approval Certification is signed by the Project Manager and the System Proponent representatives, the system including the production version of the data repository is delivered to the customer for the Operations and Maintenance Phase. The review is conducted at the end of the Implementation Phase. A post-implementation review shall be conducted to ensure that the system functions as planned and expected; to verify that the system cost is within the estimated amount; and to verify that the intended benefits are derived as projected.

CONCLUSION
We have earnestly Endeavour to carry out the given project study to the best of our capacities. However due to time constraints, this project could not be carried out as per the initial set objectives. This would include the following:

Record editing facility.

Record viewing Facility.

REFERENCES
1. The Complete Reference to Java by Herbert Schdilt. 2. Teach Yourself Java in 21 Days. 3. Gateway to SCJP by Keyur Shah. 4. A programmers guide to JAVA 2 by Ivor Harton. 5. OOPS with JAVA by E. Balagurusamy.

You might also like