• No results found

A DATABASE-BACKED CLIENT-SERVER APPLICATION IN JAVA FOR CUSTOMER BOOKINGS

N/A
N/A
Protected

Academic year: 2021

Share "A DATABASE-BACKED CLIENT-SERVER APPLICATION IN JAVA FOR CUSTOMER BOOKINGS"

Copied!
35
0
0

Loading.... (view fulltext now)

Full text

(1)

Örebro universitet Örebro University

Institutionen för teknik Department of technology

A DATABASE-BACKED CLIENT-SERVER

APPLICATION IN JAVA FOR CUSTOMER

BOOKINGS

Reg.kod: Oru-Te-EXD088-D101/03

Rolando Ccorahua Corneliosson

Programme for Computer Engineering, 160 points Örebro-Sweden Autumn 2003

Supervisor: Thomas Padron-McCarthy Examiner: Lars Karlsson

(2)

Preface

This report has been done by Rolando Ccorahua Corneliosson. The report describes a 10-point project in order to complete a masters degree in Computer Engineering at the University of Örebro, Sweden. The project has been done during the autumn term of 2003.

(3)

Abstract

This report describes the development of two applications and a database. The first application is a client application and the second application is a server application. The server application will perform the link function between the client and the database source. The aim of this system is to handle the database administration at The Tigers, which is a chain of gyms in Sevilla, Spain. The chain consists of four gyms, located in different places. To develop this system, technologies such as Java, Microsoft Access 2000, Windows 2000 Professional and Windows 2000 Advanced Server were used.

(4)

CONTENTS

CONTENTS ... 4

1 BACKGROUND... 6

2 INTRODUCTION ... 6

3 TASK ... 7

4 REQUIREMENTS ... 8

4.1 CLIENT APPLICATION... 8 4.2 SERVER APPLICATION... 8 4.3 DATABASE... 9

5 IMPLEMENTATION TOOLS ... 9

5.1 JAVA... 9 5.2 MICROSOFT ACCESS 2000... 10 5.3 CONNECTION TO A DATABASE... 10 5.3.1 JDBC ... 11 5.3.2 ODBC... 11 5.3.3 JDBC-ODBC Bridge ... 11 5.3.4 SQL ... 12

6 DESIGN OF THE SYSTEM ... 12

6.1 DESIGN TOOLS... 12

6.2 THE SYSTEM SEEN FROM THE USER’S POINT OF VIEW... 13

6.3 SUBSYSTEM... 13

6.3.1 Class diagram for the client application... 14

6.3.2 Class diagram for the server application ... 15

7 COMMUNICATION ... 16

7.1 CLIENT AND SERVER APPLICATION INTERACTING WITH STREAM SOCKET CONNECTIONS... 16

7.2 MAKING CONNECTION AND INTERCHANGING DATA TO MANIPULATE THE DATABASE... 17

7.3 DATABASE... 18

7.3.1 Clarifications about certain fields... 18

8 SECURITY... 19

8.1 CRYPTOGRAPHY... 19

8.2 INTRANET... 20

9 RESULT ... 21

9.1 CLIENT APPLICATION CUSTOMER... 21

9.1.1 Components and their functionalities... 22

9.1.1.1 The file menu... 22

(5)

9.2 SERVER APPLICATION 2DB ... 29

9.2.1 Components and their functionalities... 29

9.2.1.1 Clients connecting ... 29

9.2.1.2 The file menu... 30

9.2.1.3 The help menu ... 30

10 INSTALLATION... 32

11 CONCLUSION ... 33

11.1 WHAT I LEARNT... 33

11.2 CURRENT LIMITATIONS AND FUTURE IMPROVEMENTS... 33

12 TERMINOLOGY... 34

(6)

1 Background

The Tigers is a company, which consists of four different training centers. The company is set up in Sevilla, Spain. The training centers offer people different sort of activities, such as gym, aerobics and spinning. In order to be able to enter the centers you have to be either a member or pay for each running session.

2 Introduction

Many companies dealing with a big amount of data are dependent on a database program to store the entries. In this case the company has four different training centers, and in order to handle the membership every training center is supplied with a computer running Windows 2000 Professional as operating system. The information about the members is stored in a database program called Microsoft Access 2000. This means that The Tigers have four different databases, each of them for one training center. The members are assigned a unique identification number in order to get in their respective training centers.

Since it has becoming more and more popular to stay fit, active and healthy for significantly longer than the preceding generation, the amount of members at The Tigers has increased during the last 2 years. At this moment the amount of members in each center is around 5000. Considering the member increase, the company has made the decision to set up an Intranet so that the computers may be able to communicate with each other, and in that way have only one database instead of having four. This solution would enable any member to enter any of the four gyms, which is not possible at this time. For this reason they need a GUI application in order to interact with the database program.

(7)

3 Task

The goal is to develop a system consisting of two applications to access and manipulate a database. The first application will be a client application and the other one will be a server application. This second one will perform the link function between the client and the database program. This means that the client to make any request to the database has to go through the server application (server process). In this way you make the communication more secure. Usually if you use a client/server database, such as Oracle or Microsoft SQL Server, the database management systems can store individual SQL statements or sets of SQL statements in a database. Such SQL statements are called stored procedures so that programs accessing that database can invoke them. Stored procedures assist in achieving a consistent implementation of logic across applications. The SQL statements and logic needed to perform a commonly performed task can be designed, coded, and tested once in a stored procedure. Each application (i.e. client application) needing to perform that task can then simply execute the stored procedure. However the Microsoft Access 2000 does not support stored procedures. So that instead of implementing store procedures, SQL statements will be embedded in a set of functions, which will be implemented in the server application. Each client application may then invoke the functions to request information that satisfies given criteria. The following figure shows the system to be developed.

Figure 2: System to be developed

Client Application Client Application Client Application Client Application Server Application Database

(8)

4 Requirements

There are here some basic requirements that must be fulfilled in order to handle the members of the gym in The Tigers:

4.1 Client application

• An application with a GUI similar to the Windows standard GUI will be developed. • The client application will be developed with functionality that will present a

user-friendly mechanism for interacting with the server application.

• The GUI will have components, such as check, search, add, delete and change to easily manipulate data in the database through the server application.

• The GUI will have menu components, such as file and help. The file menu will contain two sub menus. The first one will be connect and the second one exit. Clicking on

connect will activate a dialogue box. The dialogue box will contain three text fields to

enter IP-address, user name and password. Clicking on exit will close the application. The help menu will contain two sub menus. The first one will be Help Topics and the second one About. Clicking on Help Topics a help file will be started and clicking on

About an information about the program and its developer will appear.

• The GUI will have a component that will display the connection status to the server application. This means that it will display whether the connection to the server application succeeds or not.

• The GUI will have a component, which displays whether a certain operation succeeds or not. Such an operation could be check, search, add, delete or change.

• The application will be run on Windows 2000 Professional.

4.2 Server application

• An application with a GUI similar to the Windows standard GUI will be developed.. • The server application will automatically establish a connection to the database server

when it starts.

• The server applicationwill have a component that will display the connection status to the database server. This means that it will display whether the connection to the database server succeeds or not.

(9)

• The server application will contain components, which will display the number of client applications connected to the database server.

• The server application will show what kind of operation a certain client is making. Such operation may be Search, Add, Delete, Check or Update.

• The server application will accept only four clients simultaneously.

• The server application will have menu components, such as file and help. The file menu will contain only one sub menu, exit. Clicking on exit will close the application. The help menu will contain two sub menus. The first one will be Help Topics and the second one About. Clicking on Help Topics a help file will be started and clicking on

About an information about the program and its developer will appear.

• The server application will be run on Windows 2000 Advanced Server.

4.3 Database

• The database program to store information about the customers will be Microsoft Access 2000.

• A suitable database will be developed to store all the information about the members. • The user names and the passwords used by the client applications will also be store in the

same database as the information about the members. This means that there will be developed one table for storing information about the members and another table for storing user names and passwords.

5 Implementation tools

There are many different programming languages that can be used to develop an application to manipulate data in a database system, such as Oracle, SQL server and Microsoft Access 2000. Such languages are C++, Visual Basic and Java.

Since the company may change the platform in the future I chose Java to develop both applications. The technologies used in order to implement the system are briefly described in the following sections. Notice that if you would like to know more about these technologies, look at section 12 where you find some sources related to them [1, 4, 6, 7, 9].

5.1 Java

Java is an object-oriented language, which was developed at Sun Microsystems. Java was announced to the world On May 23, 1995 that it was official. Since then Java has become the language of choice for implementing Internet and Intranet-based applications and software for devices that communicate over a network. It is no longer a language used simply to make

(10)

World Wide Web pages. It is one of the languages for meeting many organisations’ programming needs. This means that you can develop applets and applications with Java. The difference between an application and an applet is that an application is a program, such as an email program, a drawing program, which is normally executed from the user’s local computer, and an applet is a small program, which is normally stored and loaded from a remote computer into the browser, executed in the browser and discarded when execution completes.

A major advantage of Java is its platform independence. The same compiled code can be run on any machine or web browser that supports Java. Java source code is compiled into Java byte code, which is platform independent.

At run time, this byte code is executed by a Java interpreter. These interpreters are platform dependent and exist on each machine or within a web browser. For running independent applications, the interpreter can be downloaded and installed onto any machine for free. You can even download the entire JDK (Java Developers Kit), which is also free. This includes all the compilers, libraries, and other tools necessary to develop Java applications.

There is of course disadvantage with java as with everything. The major disadvantage of Java, from an applet user’s perspective, is the speed of execution. This can be frustratingly slow due to the limited bandwidth of the communications channel and the added delay caused by the network browser translating the byte code. It is also slow when executing an application in comparison with applications developed with C++ or Visual Basic. However, Java continues to grow rapidly and will always have a place in the programming world.

5.2 Microsoft Access 2000

Access 2000 is the fifth version of the successful desktop database from Microsoft. The first version was released in 1992. Each release of Access has added features and increased

usability, and with Access 2000 you can now have a unified development environment for the whole of the Office 2000 suite of applications.

5.3 Connection to a database

A database is an organised collection of data. There are different methods for organising data to facilitate easy access and manipulation. A database management system (DBMS) provides mechanisms for storing and organising data consistently. Today’s most popular database systems are relational databases, such as Oracle, Microsoft SQL Server and MySQL. In this project I used Microsoft Access 2000. The Java application communicates with the database, and manipulates its data, using the JDBC-ODBC Bridge.

(11)

5.3.1 JDBC

JDBC stands for Java Database Connectivity. It is a technology developed at Sun

Microsystems, which is used for allowing external access to SQL database manipulation and update commands. This means that a JDBC driver implements the interface to a particular database. Most popular database management systems now include JDBC drivers.

5.3.2 ODBC

ODBC stands for Open Database Connectivity. It is a standard designed by Microsoft, which allows applications to access databases in various platforms. ODBC enabled applications can easily access data in any database that provides an ODBC driver for that particular database. There are two versions of ODBC, ODBC32 and ODBC. The first one is for modern databases and the second one is for old databases.

5.3.3 JDBC-ODBC Bridge

The JDBC-ODBC driver connects Java programs to Microsoft ODBC (Open Database Connectivity) data sources. The Bridge is installed automatically with the Java 2 Software Development Kit (J2SDK), Standard Edition, and is implemented as package sun.jdbc.odbc. The Bridge is used by opening a JDBC connection using an URL with the odbc sub protocol, which is of the form:

jdbc:odbc:<data-source-name>[;<attribute-name>=<attribute-value>]* For example:

JDBC:ODBC:MYDB;UID=MYID;PWD=MYPASSWORD

Before a connection can be established, the bridge driver class, sun.jdbc.odbc.JdbcOdbcDriver,

must be explicitly loaded using the Java class loader. Explicit loading is done with the following line of code:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

The whole Java connection code to a certain database source (i.e. Microsoft Access 2000) may be of the following form:

Connection myConnection = null; String url="jdbc:odbc:myDB.mdb";

Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); myConnection =DriverManager.getConnection (url);

(12)

5.3.4 SQL

SQL stands for Structured Query Language. SQL is the standard language used among relational database systems to make queries. SQL statements are used to perform tasks, such as update data on a database, or retrieve data from a database [7]. Some relational database management systems that use SQL language are:

Oracle, Microsoft Access 2000 and Microsoft SQL Server.

For example a SQL statement in order to select information about a certain person stored in the database may be of the following form:

SELECT * FROM customer WHERE customerId = 10020

After executing the statement above the retrieved data from the database customer will be all the information about the person who has 10020 as customer Id.

6 Design of the system

6.1 Design tools

In order to develop the system I used the following software and hardware:

• A server computer, Intel Pentium 4, processor speed 2000 MHz and memory 1024 MB. • Four workstations, Intel Pentium 2, processor speed 266 MHz and memory 128 MB. • Microsoft Windows 2000 Professional as operating system in the workstations.

• Microsoft Windows 2000 Advanced Server as operating system in the server computer. • The database program Microsoft Access 2000.

• Borland JBuilder 8.0 for programming.

• TextPad 4.0.5: 32-bit Edition for programming. • Microsoft Word 2000 for writing some documents.

(13)

6.2 The system seen from the user’s point of view

The figure below is about the architecture of the whole system. It shows how the subsystems are related to one another.

Figure 3: Architecture of the whole system

6.3 Subsystem

Before a system is validated many tests must be done first. Every single subsystem must work properly. In this case it means that in order to test the server application, a database server must be available, otherwise the server application would not be tested at all. It is the same case with the client application: a server application must be available and work properly before the application can be tested. In order to picture this, look at the figure below.

Database (select, update…) Computer one Client application Computer two Client application Computer three Client application Computer four Client application Server computer Server application Request Response Intranet ………. ………. ………. ………. ………. ………. ………. ………. ……….

(14)

Figure 4: Architecture of the subsystems

6.3.1 Class diagram for the client application

In order to implement the client application one designed the class diagram in figure 5. The diagram models the general structure of the application by depicting the classes, or building blocks, of the system. Notice that the diagram only shows the most important classes and their important attributes (variables) and operations (functions).

Figure 5: Classes of the client application

The diamond on the association lines of figure 5 indicates, for example, that the Client class is built of the ThePanel class. Such relationship is called aggregation. This means that the

ThePanel class is an aggregation of one object of class Socket, PrintWriter, Subsystem Server application check() search() add() delete() change() Subsystem CustomerDB Subsystem Client application

(15)

6.3.2 Class diagram for the server application

In order to implement the server application one designed the class diagram in figure 6. The diagram models the general structure of the application by depicting the classes, or building blocks, of the system. Notice that the diagram only shows the most important classes and their important attributes (variables) and operations (functions).

Figure 6: Classes of the server application

The diamond on the association lines of figure 6 indicates that the CustomerMain class is built of the ServerSocket and that the CustomerThread class is an aggregation of one object of class Socket, PrintWriter and BufferedReader. The dashed arrow expresses dependency. This means that the CustomerThread class depends on the CustomerFunctions and

CustomerMain class. What is more, the CustomerFunctions class depends on CustomerRecord class.

(16)

7 Communication

The communication applied between the client and the server application is socket-based communication. An application or program can read from a socket or write to a socket in the same way as when reading from a file or writing to a file. Since the applications interchange information, a stream socket is used. With a stream socket, a process (called the client process) establishes a connection to another process (called server process). While the connection is in place, data flows between the applications in continuous streams. The protocol used for transmission of data is the popular TCP/IP (Transfer Control

Protocol/Internet Protocol). TCP moves multiple packets of data between applications and IP moves data between host computers. This means that both go together in order to switch packets from computer systems on any network to another network. Using only IP would be useless without any transportation protocol such as TCP [5].

7.1 Client and Server application Interacting with Stream Socket connections

It is the server application that will create a server-socket object, in order to listen for clients that try to connect to it. It will currently accept only four clients. When the application starts, it creates automatically a Server Socket object. A call to the ServerSocket constructor is made as follows:

ServerSocket listening = new ServerSocket(port);

The constructor establishes the port where the server waits for connection from clients. The port number is used by the client application to locate the server application. Port numbers between 0 and 65535 can be used. The ports below 1024 are reserved for system services (i.e. World Wide Web and FTP servers). In this project a port above 1024 is used.

In order to connect to the server application, the client application creates a Socket object as follows:

Server connecting = new Server(serverAddress, port);

The constructor takes two arguments. The first one is the IP address to the server computer where the server application is run and the second one is the port number where the server application waits for any connection. In this project the port is fixed but the IP address (server address) is not. When trying to connect the client application to the server application, the user must enter in the dialogue box, a user name, a password and an IP address. See section 9.1.1.1, figure 17.

All this means that when the two objects are created, a connection is established between the server application and the client application. A general overview about the whole system using the TCP/IP protocol is showed in the figure below.

(17)

Figure 7: Communication over the Intranet

7.2 Making connection and interchanging data to manipulate the database

The applications use a kind of own protocol to communicate to one another. First of all, in order to manipulate the data source a connection between the client and server application must be established. The connection process is shown in the table below.

Client application Customer Server application 2DB Client number one connects Accepts

Sends "CONTROL; user name; password" Checks the user name and the password in the database. If the client exists, It sends back "ACK", if not, it sends back "NACK" and closes the client.

Client number two connects Accepts

Sends "CONTROL; user name; password" Checks the user name and the password in the database. If the client exists, It sends back "ACK", if not, it sends back "NACK" and closes the client.

Client number three connects Accepts

Sends "CONTROL; user name; password" Checks the user name and the password in the database. If the client exists, It sends back "ACK", if not, it sends back "NACK" and closes the client.

Client number four connects Accepts

Sends "CONTROL; user name; password" Checks the user name and the password in the database. If the client exists, It sends back "ACK", if not, it sends back "NACK" and closes the client.

Client number five connects Does not accept and sends back "TRY LATER" Operating System

Client

CUSTOMER Client TELNET

Port Port TCP IP Client host Operating System Server process 2DB Server TELNET Port Port TCP IP Server host

(18)

Once a connection has been established between the client and server application, the manipulation of data in the database server can begin. Look at the communication system in the table below:

Client application Customer Server application 2DB Request Response Operation Operation suceeds Operation fails Checking "CHECK;customerId" "ACK;name;age;..." “NACK” Search "S;Idnumber" "ACK;customerId;Name;…" “NACK” Add "A;name;age…" "ACK;customerId" “NACK” Delete "D;Idnumber" "ACK" “NACK” Update "U;adress;activity..." "ACK" “NACK”

Figure 9: Table showing the interchange of data

From the table above you can see that the client only sends strings to the server application. It is the server application that acquires the correct data from the string in order to manipulate the database. If it gets wrong data or the operation fails, it sends back NACK to the client application. When the operation succeeds it sends back ACK, plus a few parameters dependent on what the client application is requesting. For instance if the client application requests information about a certain member it sends the message CHECK, plus the

customer-id, and the server application sends back ACK, plus information about the member, such as name, age and address. See figure 9.

7.3 Database

The database program used in this project is Microsoft Access 2000. It contains two tables. The first one is for storing the user names and passwords. The user names and passwords are used by the client application in order to connect to the server application. The second table is for storing information about the members.

These two tables have the following schemas:

Figure 10: Database table, secretDb

Figure 11: Database table, customers

7.3.1 Clarifications about certain fields

(19)

What about the table customer? See figure 12. The field customerId and the field idNumber are indexed. By having this fields indexed you make for example searching operations faster. Indexing also means that the values in these fields are unique. Since the values in field

customerId and idNumber are unique, there should not be entered two different members

with the same customer-id number or identification number. The field onOff contains the values ON/OFF. When a certain member is not allowed anymore to enter the gym, in such situation this field is set to OFF, otherwise ON. There could be any number of reasons for this. (e.g. not enough credit). Look at the picture below.

Figure 12: Some entries

In the figure above you see that the field onOff is set to OFF. That is because the member Maria has paid only until 2003-09-02, as shown in the field duration in figure 12. She cannot enter the gym until she renews her membership. What the other fields stand for is obvious.

8 Security

The security issues arise when communicating in computer networks. Actually breaking into a computer system or sniffing transferred information is a everyday problem. For instance computers joined a network can be protected from intruders by using firewalls. Even if the computer network would be safe, the transferred information in the network would still be unsafe. Therefore one should put more effort to protect data communication across the network systems from revealing its contents. Cryptography and intranet using VPN (Virtual Private Network) technology are methods to increase the security, in order to protect

computer networks, their applications and the communication across the network.

8.1 Cryptography

This technique is useful to protect the transferring data across the network. The transferred data to be encrypted is called plaintext and the output of the encryption is called ciphertext. Besides the function, which encrypts the plaintext is parameterized by a key. For instance when an intruder captures a packet, he or she does not know what the decryption key is and cannot decrypt the ciphertext easily [5]. Look at the figure below.

Figure 13: Cryptography process

Encryption function Decryption function Plaintext Plaintext Intruders Decryption key Encryption key Ciphertext

(20)

8.2 Intranet

An intranet is a network within an organization that uses Internet technologies to enable users to find, use, and share documents and web pages. When it comes to security the software and the computer system joined by an intranet, are isolated from outsiders. This is because the computers are kept within a firewall. The firewall inspects every incoming or outgoing packet [5]. To increase the security level more one can use VPN hubs integrated firewalls, which provides secure tunnelling over any supported WAN or Internet link so that computers can safely send data across the network. In that way the communications between network

computers, applications and users across the intranets will be safe. A solution using a firewall integrated with VPN may be as the figure below.

Figure 14: Applying VPN tunnel

This project is about a client application and a server application, which are run on computers joined by an intranet. Since the server application accepts remote logins, the user names and the passwords sent by the client application become easy to be tapped. This makes the system more vulnerable. In order to make the system more secure, the user names, the passwords and other transferred data should not be sent as plaintext, instead they should be encrypted first, and decrypted with a suitable method when the encrypted data is received. Since the

encryption is not done in this project, The Tigers will use a technique similar to the figure 14, in order to protect the computers, their applications and the communication across the

network.

Client Firewall Server

integrated with VPN Firewall integrated with VPN Internet VPN tunnel

(21)

9 Result

9.1 Client application Customer

This is a GUI (Graphical user Interface) application that is applied in order to administrate the membership at The Tigers.The application contains two menu components, the file menu and the help menu. Furthermore it contains five different tabs, which are labelled with Check, Search, Add, Delete and Change. When starting the program the Check layer is visible. Otherwise when the user clicks a tab (layer), the appropriate layer is displayed. What is more, the application is not connected to the server application, hence the message NOT

CONNECTED. Concerning how to connect, see section 9.1.1.1, figure 17. Once the

connection is made, the label changes to CONNECTED, see section 9.1.1.3, figure 21. The GUI also contains some other labels and text areas, in order to show the information about the members. After starting the application looks like the following picture.

(22)

9.1.1 Components and their functionalities 9.1.1.1 The file menu

The file menu contains two items. The first one is Connect, and the second one is Exit. In order to close the application one clicks Exit. Look at the picture below.

Figure 16: File menu

When clicking the sub menu Connect, a dialog window is shown. The dialog window contains three text fields, where the user is supposed to enter the name or IP-address of the remote computer (server computer), the user name and the password. Look at the picture below.

Figure 17: Dialog box

9.1.1.2 The help menu

The help menu contains two items. The first one is Help Topic, and the second one is About. Look at the picture below.

(23)

When clicking the sub-menu Help Topic, a web browser is started, showing an html file with the help re related to the application’s functionality. Look at the picture below.

Figure 19: Help file about the client application

When clicking the sub-menu About, a separate window is opened, showing the name of the company and the name of the developer of this application. Look at the picture below.

Figure 20: “About” menu

9.1.1.3 Check layer

When this layer is visible you see many components, such as labels and text fields. The

function of this layer is to display the connection status to the server application and to control the membership. When a customer arrives at the gym, they have to identify themselves by giving their customer-id. This customer-id is entered in the text field. After this operation you click the Search button in order to check if this member exists in the database.

For instance if a member with customer-id 80320 exists in the database you will get the information about the member according to the picture below (see figure 21). The message

ON means that the member has paid in advanced and is allowed to get in the gym, otherwise OFF. The message SUCCESSFUL means that the check operation has succeeded.

(24)

Figure 21: Check layer. Retrieving data.

If the member does not exit you will get empty fields according to the picture below, see figure 22. The message UNSUCCESSFUL means that the check operation has failed. In

(25)

9.1.1.4 Search layer

The function of this layer is to search for a member in the database. It may happen that the customers forget their customer-id. In such situations you enter their identification number in the text field. In this case the customer-id we are looking for is 80230. Furthermore you get some other information about the member, such as name, age, address, gender. See figure 23. The message SUCCESSFUL means that the search operation has succeeded.

Figure 23: Search layer

If the member does not exit you will get empty fields according to the picture below, see figure 24. The message UNSUCCESSFUL means that the search operation has failed. In order to make a new search operation, click the New button.

(26)

9.1.1.5 Add layer

The function of this layer is to add a member in the database. You fill the fields according to the picture below and click the OK button.

Figure 25: Add layer

If the add operation goes well you receive a customer-id according to picture below (see figure 26). The customer-id is randomly generated by the server application. In this case the customer-id is 77246. This customer-id is used by the member every time the member wants to get into the gym. The message SUCCESSFUL means that the add operation has

(27)

9.1.1.6 Delete layer

The function of this layer is to delete a member in the database. You enter the identification number of the member, as shown in the picture below, and click the Delete button.

Figure 27: Delete layer

If the delete operation goes well, the message SUCCESSFUL displays, which means that the delete operation has succeeded. See figure 28. To enter a new identification number in order to delete it, click the New button.

(28)

9.1.1.7 Change layer

The function of this layer is to update the information about a certain member in the database. You enter the identification number and get all the information about the member, as shown in the picture below.

Figure 29: Change layer

Then you make the changes needed and click the Update button. If the update operation succeeds, a message UPDATED is displayed instead of SUCCESSFUL. See figure 30. To update a new member, click the New button.

(29)

9.2 Server application 2DB

This application is run on the server computer. When starting this application it will

immediately make a connection to the database server. Each client application is handled by this application in order to contact the database server. When starting the application you will see a GUI (Graphical User Interface) according to the picture below.

Figure 31: Server application after starting

9.2.1 Components and their functionalities

The application contains a file menu, a help menu, two labels and four different text areas. Each area displays the commands made by a certain client application.

When a connection to the database is established a label, Connected to DB, is displayed. Otherwise, the label Not connected! is displayed. See the picture above, figure 31.

9.2.1.1 Clients connecting

When a client is connected to this application, you see that in the text area. What is more, you see the IP address or the name of the client computer, the time of connection of the client computer and what kind of operation a particular client is doing (i.e. check, add, delete, etc). Look at the picture below.

(30)

Figure 32: Displaying operations performed by two clients

9.2.1.2 The file menu

The file menu contains just one item, Exit, which closes the application according to the picture below.

Figure 33: Exit menu

9.2.1.3 The help menu

The help menu contains 2 items. The first one is Help Topic, and the second one is About. Look at the picture below.

(31)

When clicking the sub-menu Help Topic, a web browser is started, showing an html file with the help re related to the application’s functionality. Look at the picture below.

Figure 35: Help file about the server application

When clicking the sub-menu, About, a separate window is opened, showing the name of the company and the name of the developer of this application. Look at the picture below.

(32)

10 Installation

At this time The Tigers is still using the old system. Every training center is supplied with a computer running Windows 2000 Professional as operating system. Each computer has an own database program called Microsoft Access 2000, which the information about the members is stored in. Each database is for each training center.

The new system will be setup somewhere in the beginning of the summer 2004. As it is written in section 4, the client application will be run on a computer running Windows 2000 Professional, the server application will be run on a computer running Windows 2000 Advanced Server and the database program Microsoft Access 2000 will be installed in the server computer, where the all members at The Tigers will be stored. At the moment they are planning how to set up the intranet. Configuration concerning the database server, the client application and the server application will be done by me once the intranet has been setup. Of course unexpected problems can always occur, in that case those problems will be solved in place (at The Tigers).

(33)

11 Conclusion

11.1 What I learnt

There are many methods to develop software. What is more, there are plenty of languages to develop it in. In this case I chose Java in order to develop the applications. The applications fulfil the user requirements needed to administrate the database at the company, The Tigers. I learnt a lot developing these applications. Especially I really improved my skills at Java programming, and my understanding of the communication between two applications running in different computers joined by an Intranet. Another thing I learnt is how important it is to plan before beginning to program or write the source code. By planning one accomplishes any project in more effective way. The time of developing can also be a bit deceptive, for instance if you think that you will finish a certain project in a week, in reality you should multiply this time by three, because that is the time, which will take to finish it.

11.2 Current limitations and future improvements

Since these applications are developed with Java, it will not be any problem with running them on another platform, such as Linux. If the company makes the decision to change the platform, they will not have any problem with it. I think the company will use this application at least for a while. Of course as with other small software applications, it will need changes as the entire system keeps changing. When it comes to limitations, three more things should be improved. First, the GUI of the server application should be developed in another way. The current developed GUI contains four text areas to show each client and its performed

operations, such as Check, Search, Change, Delete and Add. But what if The Tigers decides to set up one more gym, then they will have a lot of work to do, because some programmer must make a lot of changes in the source code in order to generate one more text area. The solution to this issue would be a GUI with only one text area showing all the connected clients. In this way the programmer would change only the number of clients allowed in the source code. Second, the GUI of the server application should contain a dialog box, in order to enter the user name and the password to connect to the database server, because the current server application connects to the database server without using any user name or password, which is bad for security reasons. At last, an encryption algorithm should be developed to at least encrypt the user names and the passwords sent by the clients, in order to improve the security even more.

(34)

12 Terminology

Oracle Database Management System developed by Oracle Corporation.

C++ An object-oriented programming language created by Bjarne Stroustrup at Bell

Labs during 1983-1985 and extensively modified afterwards. It is an extension of C.

Visual Basic A graphical programming language developed by Microsoft.

Java An object-oriented programming language developed by Sun Microsystems.

MySQL An open source database developed by MySQL AB.

SQL Server A database program developed by Microsoft.

Intranet An intranet is a network within an organization that uses Internet technologies to enable users to find, use, and share documents and web pages. Intranets use traditional Internet protocols, TCP/IP and HTTP to transfer data.

ODBC Open Database Connectivity. A standard developed by Microsoft, which allows

applications to access databases in a uniform way and across various platforms.

JDBC JDBC stands for Java Database Connectivity. Sun's official position is that it does not, although that is the generally accepted assumption.

SQL Structured Query Language. A standard language to manipulate databases.

TCP Transmission Control Protocol. It is used to guarantee end to end delivery of segments of data. This means that it is a connection-oriented service.

IP Internet Protocol. It is a network layer protocol that describes how data is sent across networks.

VPN Virtual Private Networking. It provides a secure communication across the Intranet/Internet.

(35)

13 References

1 H. M. Deitel, P. J. Deitel (1999): Java how to program.

Prentice Hall. ISBN 0-13-012507-5.

2 Jan Skansholm (2002): Java direkt.

Studentlitteratur. ISBN 91-44-02228-X.

3 Thomas Connolly, Carolyn Begg(2002): Database Systems.

Addison-Wesley. ISBN: 0-201-70857-4.

4 Timothy Buchana, Craig Eddy (1999): Lär dig Access 2000 på 24 timmar.

Pagina Förlags AB. ISBN 91-636-0548-1.

5 Andrew S. Tanenbaum (2003): Computer Networks.

Prentice Hall PTR. ISBN 0-13-066102-3.

6 http://java.sun.com/

Java 2 Platform, Standard Edition (J2SE), 2003-09-24

7 http://dbforums.com/ SQL and PL/SQL, 2003-09-24 8 http://www.cse.bris.ac.uk/~ccmjs/ora_sql.htm Microsoft Access SQL, 2003-09-25 9 http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html JDBC-ODBC-Bridge Driver, 2003-10-15 10 http://www.cafeaulait.org/slides/sd2000east/sockets/

References

Related documents

x We propose a new transfer dictionary learning framework that utilizes synthetic 2D and 3D training videos to learn a dictionary that can project a real world 2D

If your sockets stop working, unplug all electrical appliances, switch off the main switch (this is usually the red one at the end), reset the circuit breaker and switch the

Select the User Name &amp; Password of the User you want to associate with the IP Office Microsoft CRM Client Integration application.. The components selected have already

(1) If personal checks, cashier's checks, traveler’s checks, payroll checks or counter checks are cashed at the cage, the gaming operation shall establish and comply with

The system administrator must provide networking information for the Synapse Mobility server, along with a user name and password for each user.Following installation of the

The chapter includes reference to recent Government policies highlighting educational provision for young people including educational reform of A Level qualifications and

based programmes for vulnerable youth who were in our network from previous evaluation research projects (Gozzoli et al., 2013). We used this sampling approach be- cause these

To study the surgical mortality and rate of reoperations for hematomas and infections after intracranial surgery for brain tumors in a large, contemporary, single-institution