You are on page 1of 12

Punjab Technical University ??A GUI Oracle Interface in Java??

By Jyotsna Vohra Under the Guidance of Ms Shalini Saxena Submitted to the Softdot HI-Tech Educational & Training Institute In partial fulfillment of the requirements For the degree of Master of Computer Applications Punjab Technical University Jallandhar ACKNOWLEDGEMENT With utmost humility, we would like to express our gratitude towards the indispensable guidance of our teacher (or guide) Ms Shalini Saxena who guided ou r path through out the development of the project entitled ??A GUI Oracle Interfac e in Java??. We express our sincere thanks to her for accomplishment of the said proj ect. Project Team Member Jyotsna Vohra CERTIFICATE This is to certify that the project report entitled A GUI Oracle Interface in Ja va submitted to Punjab Technical University in partial fulfillment of the requirement for the aw ard of the degree of MAST ER O F C OMPUT ER APPL I C A T IONS (MC A) is an original work ca rried out by Ms. JYOTSNA VOHRA enrollment no 11203250078 under my guidance. The matter embodied in this project is authentic and is genuine work done by the student an d has not been submitted whether to this university or to any other university/institute for th e fulfillment of the requirement of any course of study. ???????????????????????????????????????????????????????????????????????????????? ?????????????????????????????????????? Signature of the student: Signature of the Counsellor ???????????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????????????? ?????????????????????? Name and Address Name, Designation and of the student Address of the Counsellor ???????????????????????????????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????????????????? ?????????????????????????????????????????? PROJECT PROPOSAL Punjab Technical University Enrollment No?????????????????????????????????????????????? Study Centre???????????????????????????????????????????????????????????????????? ?????? E-mail?????????????? info@softdoteducation.com???????????????? Telephone No?????????? 011 - 47002190-95???????????????????? 1. ????????????????????????????????????????????????????????????????????????????? ??????????????? 2. ??????????????????????????????????????????????A GUI Oracle Interface in Java

3. ????????????????????????????????????????????????????????????????????????????? ??????? 4. ???????????????????????????????????????????????????????????????????? Signature of the Student Signature of the Counsellor ???????????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????????????? ???????????????? Suggestions for improving the Project: 2 ABSTRACT A GUI Oracle Interface in Java is developed under the domain of JAVA . SQL plus is a tool provide by oracle for use specifically with its database installations. It provides the user with full access to the database, Provided that has relevant permissions and/or access rides for the task they which the carryout. The problem with SQL plus, however, is that it is a Command line interface. This is not so much a problem for the staff at the Organization, but for some students, especially those with title or on computing experience, but it is a difficult task to learn to use it. The main objective of this project is to develop a GUI tool for the oracle Installation. A GUI tool would be the best thing to implement as it is more user can give, and most people who have used a computer have used a GUI in some form or other, while most will not have used a command line interface. Even if a Student has never used a computer before, they will be using a GUI when using the computers at the organization, and so will have formed some sort of mental model of how a GUI looks and works, and so will find it much easier to adapt to a command line interface. Currently the SQL plus tool can be accessed through one of two Methods: 1. A terminal window on a UNIX/LINUX machine. 2. A telnet window on a PC within the organization. The method of connecting is a command typed in by the user, who is then prompted for a username and password. Once these are entered, the user is able to the tables within their database, and create, edit, or delete da ta or tables themselves, with in their home database. The permissions for the students do not allow them access to other database or to any of the functions used to administer the database it self. 3 Index Contents page no: Chapter 1 1.Introduction 1.1 About Project 6 Chapter 2 2. Project Analysis 2.1 Project Requirements 2.1.1 Functional Requirements 10 2.1.2 Non functional Requirements 11 2.1.3 Software 12 2.2 Configuration Architecture 2.2.1 Two Tier Architecture 28 2.3 SDLC Approach 31 Chapter 3 3. Project Design 3.1 Data Flow Diagrams 34 3.2 Process Flow Diagrams 46 3.3 Data Model 47 3.3.1 Data Dictionary 48 3.4 Application Design

3.4.1 Modules 50 3.4.2 User Interface 3.4.2.1 Screens 54 Chapter 4 4. Testing 4.1 Black Box Testing 76 Chapter 5 Conclusion 78 Chapter 6 Bibilography 80 4 ? ? ????????????? 5 ABOUT PROJECT Introduction: A graphical user interface(GUI) presents a pictorial interface to a program. A GUI gives a program a distinctive look and feel By providing different applications with a consistent set of intuitive user interfa ce components. GUIs allows the user to spend less time trying to remember which key tore sequences do what and spend more time using the program in a productive manner. A GUI tool that is mainly used to identify the tables that is the user is able to the tables within their database, and create, edit, or delete data or tables themselves. Purpose: The purpose of this project is essentially to develop a tool that runs within the domain, and can securely connect to the correct oracle database depending on the user s login and password. Overview: A GUI tool would be the best thing to implement as it is more user can give, and most people who have used a computer have used a GUI in some form or other ,while most will not have used a command line interface. Even if a student has never used a computer before, they will be using a GUI when using the computers at the organization, and so will have formed some sort of mental model of how a GUI looks and works, and so will find it much easier to adapt to a command line interface. The method of connecting is a command typed in by the user, who is then prompted for a username and password. Once these are entered, the user is able to the tables within their database, and create, edit, or delete da ta or tables themselves, with in their home database. The permissions for the students do not allow them access to other database or to any of the functions used to administer the database it self. 6 Objective: The main objective of this project is to develop a GUI tool for the oracle installation. A GUI tool would be the best thing to implement as it is more user can give, and most people who have used a computer have used a GUI in some form or other ,while most will not have used a command line interface. Scope: The scope this project is essentially to develop a tool that runs within the domain, and can securely connect to the correct oracle database depending on the user s login and password. Firstly, what is needed is a tool that has two main elements: An area where the user can enter SQL code; and an area where the user can view the result of the query they have entered. The user will also require a means of connecting to the database depending on which language the GUI is

developed in. this connection will have to be secured and reliable, to ensure that it does not connect to another database accidentally, and that all commands sent via to tool are processed correctly and committed to the database correctly. The connection process will require a user name and Password form the user, and will not allow a connection if the user cannot provide these, or provides an incorrect user name and/ Password. The tool it self should be develop in a language, which is portable. By this, we do not intend to carry it with us every where we go , that it must be in a language, which can run on more than one platform. This allows the organization and any other users who implement the tool to run it without the worry of not being able to make use of it if the platform on which they use it becomes unavailable it future. Also, it means that it can be implemented on both the PC s and the UNIX/ LINUX machines with in the organization. 7 The development of the tool also needs to consider the humancomputer interaction aspects that come with the development of any GUI. It s primary concern, and the one of the primary concerns of the project it self is t o make accessing the database more friendly user. This means developing a tool which the user is comfortable user. A tool which the user can adapt to with minimum training, and can learn to more quickly, using past experience of other GUI s or simply by trial and error. Existed System: SQL plus is a tool provide by oracle for use specifically with its database installations it provides the user with full access to the database, provided that thaaViewPort ? Describe Buttons, CheckBoxes and RadioButtons ? Describe Lists and ComboBoxes Swing components: ? Provides lightweight visual components ? Contains replacement components for AWT visual components and also complex components - trees and tables ? While designing a GUI, there is a main window on which visual components are placed ? Swing components are in the javax.swing package ? All Swing components start with J. Frames ? Frame is a top level container. ? Provides place for other Swing components ? JFrame components is used to create windows in Swing program ? Its constructors are: ? JFrame() ? JFrame(String Title) ? Components have to be added to the content pane and not directly to the JFrame object Example: frame.getContentPane().add(b); 15 Panel ? JPanel component is an intermeadiate container. ? Used to group small lightwieght components together ? JPanel objects have FlowLayout as their default layout ? JPanel has the following constructors: ? JPanel() ? JPanel(LayoutManager lm). Content pane and Applets content pane makes the swing applets different from regular applets in the following ways. ? Components are added to the content pane of Swing applets, not directly to the applet

? The layout manager is set on a Swing applet s content pane, not directly on the applet ? Default layout manager for Swing applet s content pane is BorderLayout whereas for regular applet s, it is FlowLayout ? Painting code is not directly put in a JApplet object. Basic GUI Components ? A form can be used for collecting information. ? While creating GUI s, the text can be placed on the content pane using labels. ? To create elements on a GUI: ? Create the element. ? Set its attributes (size, color, font) ? Position it. ? Add it to the screen. 16 Text Components ? JText Component is the root class of all swing text components. JTextField: ? JTextField component allows us to enter/edit a single line of text. ? The constructors of this class are: ? JTextField() ? JTextField(Document doc, String text, int columns) ? JTextField(int columns) ? JTextField(String text) ? JTextField(String text, int columns). Text Area : ? JTextArea components is used to accept several lines of text from the user. ? Implements the scrollable interface to activate scrollbars ? JTextArea component can be created using: ? JTextArea() ???????????? ??????????????? ???????????? ?????????? ?????????? ??????????????? 17 ? JTextArea(Document doc) ? JTextArea(Document doc, String text, int rows, int cols) ? JTextArea(int rows, cols) ? JTextArea(String text) ? JTextArea(String text, int rows, int cols) Buttons ? Buttons trap user action. ? JButton class descends from javax.swing.AbstractButton class ? JButton object consists of a text label and/or image icon, empty area around the text/icon and border ? A JButton can be created using: ? JButton() ? JButton(Icon icon) ? JButton(String text) ? JButton(String text, Icon icon) CheckBox: ? CheckBox provides user with a set of options. ? JCheckBox class has the following constructors: ? JCheckBox() ? JCheckBox(Icon icon) ? JCheckBox(Icon icon, boolean selected) ? JCheckBox(String text)

? JCheckBox(String text, boolean selected) ? JCheckBox(String text, Icon icon) ?JCheckBox(String text, Icon, boolean selected) Radio button: ? By using the radiobutton any one option may be selected by the user . ? By using the button group to create a group. 18 ? JRadioButton object can be created by using: ? JRadioButton() ? JRadioButton(Icon icon) ? JRadioButton(Icon, boolean selected) ? JRadioButton(String text) ? JRadioButton(String text, boolean selected) ? JRadioButton(String text, Icon icon) ? JRadioButton(String text, Icon icon, boolean selected). Combo Box: ? ComboBox is a combination of texfield and drop down list. ? In Swing, combo box is represented by JComboBox class. ? public JComboBox() this constructor creates a JComboBox with a default data model. ? public JComboBox(ComboBoxModel asModel) a combo box that takes its items from an existing ComboBoxModel. ? public JComboBox(Object [] items) a combo box that contains the elements of the specified array. Menus: ? Menus show a list of items that indicate various tasks. ? Select or click an option and another list or sub-menu opens up. ? A Swing menu consists of a menubar, menuitems and menus. ? Menubar is the root of all menus and menuitems. 19 JMenuBar: ? JMenuBar is a component that can be added to a container through a JFrame. ? Consists of a number of JMenus with each JMenu represented as a string within the JMenuBar ? JMenuBar requires: ? SingleSelectionModel ? keeps track of the menu currently selected ? Look and feel class ? Responsible for drawing the menu bar and responding to events that occur in it. JMenu: ? JMenu is seen as a text string under JMenuBar while it acts as a popup menu when the user clicks on it ? JMenu has two additional classes: ??????????????? ???????? ?????????????? ????????? ???????? ???????????????? ??????????????????? ????????? ?????????? ???????? ??????? ????????? ?????? 20 ? JPopupMenu ? Used to display the JMenu s menu items ? Look and feel. ? Responsible for drawing the menu in the menubar and

for responding to all events that occur in it. JCheckBoxMenuItem: ? Contains the checkboxes as it items. ? Checkboxes are created using JCheckBox class ? May have a text string and/or an icon When a JCheckBoxMenuItem is clicked and released, the state of a menu item changes to selected or deselected. JRadioButtonMenuItem: ? Select to checkboxes except that only one radiobutton can be selected at any point of time. ? May have a text string and/or an icon ? Clicking a selected radio button does not change its state ? Clicking an unselected radio button deselects the earlier selected one. Characteristics common to Swing Components: ? Content - decides on the state of the component ? Visual appearance - determines what the component should look like ? Behavior - decides how the component should respond to events. OVERVIEW OF JDBC: ? JDBC stands for "Java DataBase Connectivity". 21 ? It is an API (Application Programming Interface) which consists of a set of Java classes, intSystems) or third-party vendors develop drivers which adhere to the JDBC specification. Other developers use these drivers to develop applications which access those databases ? SUN prepares and maintains the JDBC specification. Since JDBC is just a specification (suggestions for writing and using JDBC drivers), third-party vendors develop JDBC drivers to this specification. JDBC developers then use these drivers to access data sources. ! The use of JDBC is there only to help you (a Java developer) develop data access applications without having to learn and use proprietary APIs provided by different RDBMS vendors. You just have to learn JDBC and then you can be sure that you'll be able to develop data access applications which can access different RDBMS using different JDBC drivers. Perhaps the most common use of these Java applications will be within a company or on an "Intranet," so this might be called the Intranet scenario. For example, a company might implement all of its corporate applications in Java using GUI building tools that generate Java code for forms based on corporate data 22 schemas. These applications would access corporate database servers on a local or wide area network. However, Java applications could also access databases through the Internet. The JDBC Guide JDBC API: ? The JDBC API supports both two-tier and three-tier models statements Login Data base LEVEL 2.2.2: Alter Table 2.2.2.4.Execute the alter command 2.2.2.3.Get the Column 2.2.2.2.Get the Object name 2.2.2.1.Get the Scheme name

Login Data base Scheme name Column Sql alter details statements 36 LEVEL 2.2.4: Drop Table 2.2.4.1.Get the Scheme name 2.2.4.3.Execute the drop command 2.2.4.2.Get the Object name Scheme name Objec t name result Sql drop statements login database LEVEL 2.3 DML STMTS 2.3.2.Insert table 2.3.4.Delete table 2.3.3.Update table 2.3.1.Select table login databas e 3.DML 37 ? 2.4.2.Rollbac k 2.4.1.Commi t User database LEVEL 2.4 TCL STMTS 4.TCL 2.4.3.Define Save Point 2.4.4.Rollback To save point

LEVEL 2.3.1: Select table 2.3.1.1.Get the Scheme name 2.3.1.2.Get the Object name 2.3.1.5.Execute the select commands 2.3.1.4.Get the conditions 3.3.1.3.Get the Column details Scheme name Object name conditions Sql select statements result login database 38 PROCESS FLOW DIAGRAMS 39 DATA MODEL Introduction ? ? ? A data model is an abstract model that describes how data is represented and used. The term data model has two generally accepted meanings: 1. A data model theory i.e., a formal description of how data may be structured and used. 2. A data model instance i.e., applying a data model theory to create a practical data model instance for some particular applications. A data model theory has three main components: ? The structural part: a collection of data structures which are used to create databases representing the entities or objects modeled by the database. ? The integrity part: a collection of rules governing the constraints placed on these data structures to ensure structural integrity. ? The manipulation part: a collection of operators which can be applied to the data structures to update and query the data contained in the database. For example, in the relation model, the structural part is based on a modified concept of the mathematical relation; the integrity part is expressed in first order logic and the manipulation part is expressed using the relation algebra, tuple calculus and domain calculus. Data modeling is the process of creating a data model instance by applying a data model theory. This is typically done to solve some business enterprise requirement. 40 Business requirements are normally captured by a semantic logical data model. This is transformed into a physical data model instance from which is generated a physical database. Data Dictionary:A data dictionary is a set of metadata that contains definitions and representations of data elements. Within the context of a DBMS, a data dictionary is a read-only set of tables and views. Amongst other things, a data

dictionary holds the following information: ? Precise definition of data elements ? Usernames, roles and privileges ? Schema objects ? Integrity constraints ? Stored procedures and triggers ? General database structure ? Space allocations One benefit of a well-prepared data dictionary is a consistency between data items across different tables. For example, several tables may hold telephone numbers; using a data dictionary the format of this telephone number field will be consistent. When an organization builds an enterprise-wide data dictionary, it may include both semantics and representational definitions for data elements. The semantic components focus on creating precise meaning of data elements. Representation definitions include how data elements are stored in a computer structure such as an integer, string or date format. Data dictionaries are one step along a path way of creating precise semantic definitions for an organization. 41 Initially, data dictionaries are some times simply a collection of data base columns and the definitions of what is the meaning and type of the columns contain. Data dictionaries are more precise than glossaries (terms and definitions) because they frequently have one or more representations of how data is structured. Data dictionaries are usually separate from data models since data models usually include complex relationships between data elements. Data dictionaries can evolve into full ontology (computer science) when discrete logic has been added to data element definitions. LOGIN:COLUMN NAME DATA TYPE CONSTRAINTS username Varchar2 Primary key Password Varchar2 42 APPLICATION DESIGN Modules ? Create database. ? Data Definition Language(DDL). ? Data Manipulation Language(DML). ? Transaction Control Language(TCL). Create Database: In which user creates its own database .If it is a valid user can enter into th home page, but if a new user must use the registration button in login page to create its own database. By this we are providing security in which each user has its own database and others cannot view it. Data Definition Language: The language is used to define the data in the database is called data definition language(DDL). In simple words DDL is used to create the database, alter the database and delete the database. The result of compilation of DDLstatements is a set of tables that is stored in a special file called data dictionary. The DDL is used by the conceptual schema to store or retrieve the records to or from the database respectively , where these records describes entities, attributes and relationships. The DDL is also known as data storage and definition language used by the internal schema which describes how the data is actually store. The result of compilation of the statements of this language of this specifies the impementation details of the database schemas, details are usually hidden from the users. DDL commands are create,alter,truncate,drop. 43

DDL statements are used to define the structure of the data and include statements like : CREATE : It is used to create new tables. ALTER : It is used to alter the structure of the data. DROP : It is used to delete a table. TRUNCATE : It is used to delete all the records from table Data Manipulation Language: The language is used to manipulate the data in the database is called data manipulation language(DML). The DML is used to retrieve the data from the database , insertion of new data into the database and deletion or modification of existing data. The operation of retrieving the data from the database using DML is called as query. A query is a statement in the DML that requests the retrieval of the data from database. The portion of DML used to pose query is known as query language. The query language contains commands to select and retrieve the data from the database. Commands are also provided to insert, delete, select and update the records. 44 INSERT : This is used insert the data into the Database table. Note : Number and sequence of data values must match that of columns in the table. UPDATE : It is used to update the records in the Table. DELETE : It is used to delete the all the rows from the table as well as specified rows from the table. SELECT: It is used to display the required information from the table. Select : used to select the specified rows. From : specifies the table from which rows are to be selected. Where : specifies the condition to restrict the selection of rows. Group by : this clause groups rows in 2 ways : ? It groups rows with similar values in the specified grouping columns. ? It suppresses rows that are duplicate with respect to all columns, counting each set of duplicate rows as a group. Note: except group by field, all the other selected values should be function of some column 45 Transaction Control Language: TCL commands are used to control the (transactions) changes made by data Manipulation Language commands. These statements include : COMMIT : It is used to end current transaction and make permanent all changes performed in the transaction. i.e., it is used to store the data permanently. ROLLBACK : Discards all changes made by the current transaction in the database. An abnormal termination also causes the transaction to ROLLBACK SAVE POINT : To get back the data up to certain point. 46 USER INTERFACES Screens:

If the user enters username and password then the user must click the submit button and enters the home page but if a new user must click the registration button and user goes to the create database page.In which user can create its own database. Welcome to home page If the user enter correct username and password it enter into home page in this he can click any one of the module . 47 Creation of a Database: If a new user clicks registration button in the loginpage it enter into this pag e in which user can create its own database, in which user gives username and password to create new database. 48 Take Grant Permissions: If the new user clicks submit button in create database and it enter into this page,in which user get the grant permissions. 49 Drop Table: In this user can delete the whole table by using drop command , in this we give the table name and database name in textfields and click the delete button. 55 Welcome to DMLStatements:

You might also like