0% found this document useful (0 votes)
101 views36 pages

Mini Project Report

This document describes a client-server application that was designed using Java socket programming. The objectives of the application are to: 1) Allow users to transfer files between a client and server. 2) Provide logs of file transfers including time, file name, and destination directory. 3) Handle multiple client access. The methodology section describes how the client-server application was designed using Java sockets in NetBeans. The client sends requests to the server, which processes the requests and returns responses to the client. Expected outcomes include enabling women to pursue careers and education from home. Hardware and software requirements are also listed.

Uploaded by

Dency Sangani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views36 pages

Mini Project Report

This document describes a client-server application that was designed using Java socket programming. The objectives of the application are to: 1) Allow users to transfer files between a client and server. 2) Provide logs of file transfers including time, file name, and destination directory. 3) Handle multiple client access. The methodology section describes how the client-server application was designed using Java sockets in NetBeans. The client sends requests to the server, which processes the requests and returns responses to the client. Expected outcomes include enabling women to pursue careers and education from home. Hardware and software requirements are also listed.

Uploaded by

Dency Sangani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

CHAPTER 1

INTRODUCTION

PROBLEM STATEMENT:

From sacrificing their dreams, education, jobs or hobbies to being the first women CEO of a

OBJECTIVES:

1. This system is a file-transfer system that can help users connect in the network.

2. The file-transfer module allows the user to transfer file to the other.

3. This module could provide the user with the log of the file-transfer including time, the
name of the file, as well as the directory where the file is saved if you are the receiver, or
the directory where you choose the file if you are the sender.

4. Through the use of these sharing systems things become much easier especially in
economic level in such a way that people started to share information and data such as
files containing electronic books in text files, pictures etc., this is simply by one or few
people buying the product and sharing it with the rest hence economically better.

METHODOLOGY TO BE FOLLOWED:

The application was designed


using socket programming in
Java NetBeans supported by
TCP datagram. The client
server
based application has many
functions. The two programs
1
(client and server) were
simulated, demonstrated and
analyzed.
A. Application Concepts
This research study used a
specific scenario in designing
the
client server application in
order to demonstrate the
proper
implementation of socket
programming. The researchers
designed and implement a
client server based application
run
in a distributed computing
environment called “OpTel
Billing

2
Service (OBS)”. This application
implements communication
between a client and a server.
Further, the application
involves
only one client and one server;
with the following
requirements:
a. The client sends enquiries
to the server;
b. The server executes the
commands and displays
whatever the server sends back
to the client;
c. The OBS application is a
standard application
available in all OpTel branches
wherein the customer
can enquire about their bills;

3
d. The application must be
able to handle multi-users
access on the client side;
The application was designed
using socket programming in
Java NetBeans supported by
TCP datagram. The client
server
based application has many
functions. The two programs
(client and server) were
simulated, demonstrated and
analyzed.
A. Application Concepts
This research study used a
specific scenario in designing
the

4
client server application in
order to demonstrate the
proper
implementation of socket
programming. The researchers
designed and implement a
client server based application
run
in a distributed computing
environment called “OpTel
Billing
Service (OBS)”. This application
implements communication
between a client and a server.
Further, the application
involves
only one client and one server;
with the following
requirements:

5
a. The client sends enquiries
to the server;
b. The server executes the
commands and displays
whatever the server sends back
to the client;
c. The OBS application is a
standard application
available in all OpTel branches
wherein the customer
can enquire about their bills;
d. The application must be
able to handle multi-users
access on the client side;
The application was designed
using socket programming in
Java NetBeans supported by
TCP datagram. The client
server

6
based application has many
functions. The two programs
(client and server) were
simulated, demonstrated and
analyzed.
A. Application Concepts
This research study used a
specific scenario in designing
the
client server application in
order to demonstrate the
proper
implementation of socket
programming. The researchers
designed and implement a
client server based application
run

7
in a distributed computing
environment called “OpTel
Billing
Service (OBS)”. This application
implements communication
between a client and a server.
Further, the application
involves
only one client and one server;
with the following
requirements:
a. The client sends enquiries
to the server;
b. The server executes the
commands and displays
whatever the server sends back
to the client;
c. The OBS application is a
standard application

8
available in all OpTel branches
wherein the customer
can enquire about their bills;
d. The application must be
able to handle multi-users
access on the client side;
The application was designed
using socket programming in
Java NetBeans supported by
TCP datagram. The client
server
based application has many
functions. The two programs
(client and server) were
simulated, demonstrated and
analyzed.
A. Application Concepts

9
This research study used a
specific scenario in designing
the
client server application in
order to demonstrate the
proper
implementation of socket
programming. The researchers
designed and implement a
client server based application
run
in a distributed computing
environment called “OpTel
Billing
Service (OBS)”. This application
implements communication
between a client and a server.
Further, the application
involves

10
only one client and one server;
with the following
requirements:
a. The client sends enquiries
to the server;
b. The server executes the
commands and displays
whatever the server sends back
to the client;
c. The OBS application is a
standard application
available in all OpTel branches
wherein the customer
can enquire about their bills;
d. The application must be
able to handle multi-users
access on the client side;
The application was designed using socket programming in Java NetBeans supported by
TCP datagram. The client server based application has many functions. The two programs
(client and server) were simulated, demonstrated and analyzed.

A. Application Concepts

This research study used a specific scenario in designing the client server application in
order to demonstrate the proper implementation of socket programming. The researchers
11
designed and implement a client server based application run in a distributed computing
environment called “OpTel Billing Service (OBS)”. This application implements
communication between a client and a server. Further, the application involves only one
client and one server; with the following requirements:
a. The client sends enquiries to the server.
b. The server executes the commands and displays whatever the server sends back to the
client.
c. The application must be able to handle multi-users access on the client side.
d. A distributed application enables a client (customer) to send request to the server. The
server manages all the requests coming from the client and maintains customer’s request.

B. Interface Design

Fig 2: Client Server Application creates Project with Java Packages

Fig 2 demonstrates the programming style used in the development of client and server
programs. The researchers used one project with two java classes namely : Client and
Server. In this case, two programs were linked together to come up with functional
application that meet specific objectives of the research.

Fig 4: Established connections


with the use of temporary
ports assigned

Fig 3 : Established connections with the use of temporary ports assigned

Fig 3, demonstrate how the two programs is connected through sockets with the use of port.
The two programs were successfully connected using the port 7777. The ports of two
programs are essential as it

12
EXPECTED OUTCOMES:

1. My mini project will help the women (specially housewives) to pursue their desired
dreams or aspirations by doing work from home or just by learning courses they
like.
2. This enables a broader exposure for women to choose what they want and it will be
easy for them to progress in the outer world.
3. It promotes education and freedom of pursuing their careers for women who had to
sacrifice their dreams and aspirations due to their situations.
4. Through this, both the parties (i.e. the women as well as the industry) can directly
connect with each other without interference of the third party. This will improve
and benefit the organisations specially working for women.
5. One of the best ways to enhance women empowerment in countries like India
where people believe that women can’t be ahead of men and manage their work life
and personal life.

13
HARDWARE AND SOFTWARE REQUIREMENTS:

HARDWARE REQUIREMENTS:
1. Processor- intel core i5 generation.
2. Ram- 2GB or more.

SOFTWARE REQUIREMENTS
1. Software-NetBeans 7.2
2. Database-MySQL 5.5
3. OS- Windows 7 or later
CHAPTER 2
OBJECT ORIENTED CONCEPTS

INHERITANCE:
It is one of the important concepts of Object-Oriented programming which is widely
used by the programming language Java.
Inheritance is basically defined as the capability of a class to derive properties from
another class. The class inheritance lets us to derive new classes from the old ones,
with the derived class inheriting the properties including the methods of the old class.
One of the main advantages of inheritance is code reusability. Once the base class is
written and debugged, it can be used in various situations without having to redefine it
or rewrite it. There are many types of inheritances like single, multiple,multi-
level,multi- path,hierarchical and hybrid. Few of them are as follows:
Types of Inheritance:
1. Single Inheritance- When a subclass inherits only from base class, it is known as base
class or super class. And it is said that the subclass inherits from the base class.
Inheritance may take place in many forms. One of the forms is the Single Inheritance.
When a subclass inherits only from one base class it is known as Single Inheritance.
The below depiction shows Single Inheritance:

Base class
X

Derived class
Y

2. Multiple Inheritance- refers to the concept of one class extending (Or inherits) more
than one base class. The problem with “multiple inheritance” is that the derived class
will have to manage the dependency on two base classes. Using Multiple inheritance
often leads to problems in the hierarchy. This inheritance is not supported by .net
Languages like C#, F# etc. and Java Language.
A B

CLASSES:

A class is a user defined blueprint or prototype from which objects are created. It
represents the set of properties or methods that are common to all objects of one type.
A class is an entity that determines how an object will behave and what the object will
contain. A Java class must be stored in its own file. A Java class is a single, coherent unit
of Java code which belongs together. It may contain a mix of data (variables) and
actions (methods). Grouping variables and operations on these variables into Java
classes makes it easier to structure your Java program when it gets too big to fit
comfortably inside a single Java class. A class in Java can contain:

 Fields
 Methods
 Constructors
 Blocks
 Nested class and interface

A class declaration constitutes of the following parts:

 Modifiers
 Class name
 Keywords
 The class body within curly brackets {}
JAVA METHOD:
A method is a block of code which only runs when it is called. You can pass data, known
as parameters, into a method. Methods are used to perform certain actions, and they
are also known as functions. They are used to perform a set of instructions.
The methods are classified into two types:
1. Pre-defined Functions- These functions are defined by the java language creators.
The function they have to perform are already defined and can’t be changed by
the normal users.
2. User-defined Functions-These functions are defined by the users during the
execution of the programs. They can be changed or modified according to the
user’s requirements.
If we want to use the set of instructions again and again then we can call the functions
or the methods so that we can implement code reusability. For using a method, it
should be called. There are two ways in which a method is called i.e., method returns a
value or returning nothing (no return value).
The process of method calling is simple. When a program invokes a method, the
program control gets transferred to the called method. This called method then returns
control to the caller in two conditions, when:

 the return statement is executed.


 it reaches the method ending closing brace.

ENCAPSULATION:

It is also one of the important principles of Object-Oriented Programming. Encapsulation


in Java is a mechanism of wrapping the data (variables) and code acting on the data
(methods) together as a single unit. Technically in encapsulation, the variables or data of a
class is hidden from any other class and can be accessed only through any member
function of own class in which they are declared.
As in encapsulation, the data in a class is hidden from other classes using the data hiding
concept which is achieved by making the members or methods of class as private and the
class is exposed to the end user or the world without providing any details behind
implementation using the abstraction concept, so it is also known as combination of data-
hiding and abstraction. Encapsulation can also be referred to as bundling fields and
methods inside a single class. Encapsulation can be achieved by: Declaring all the variables
in the class as private and writing public methods in the class to set and get the values of
variables. It’s because encapsulation has a number of advantages that increase the
reusability, flexibility and maintainability of the code.
 Flexibility: It’s more flexible and easier to change the encapsulated code with new
requirements.
 Reusability: Encapsulated code can be reused throughout the application or
across multiple applications.
 Maintainability: Application ode is encapsulated in separate units (classes, interfaces,
methods, setters, getters, etc) so it’s easy to change or update a part of the
application without affecting other parts, which reduces the time of maintenance.
 Getter and Setter Methods – Private member can only be accessed within the same
class. An outside class cannot access the data members of that class. If you need to
access these variables, you have to use public “getter” and “setter” methods.
 Testing of the code – Ease of testing becomes easy. So, it is better for Unit testing.
 Data Hiding – It can provide the programmer to hide the inner classes and the user to
give access only to the desired codes. It allows the programmer to not allow the user
to know how variables and data store.

POLYMORPHISM:

It is a concept by which we can perform a single action in different ways. There are two
types of polymorphism in Java, i.e. compile-time polymorphism and runtime
polymorphism. We can perform polymorphism in java by method overloading and method
overriding. Polymorphism allows you to define one interface and have multiple
implementations. Polymorphism uses those methods to perform different tasks. The types
of the polymorphism are as follows:

1. Compile-time Polymorphism-It is also known as static polymorphism. This type of


polymorphism is achieved by function overloading or operator overloading. When there
are multiple functions with same name but different parameters then these functions
are said to be overloaded. Functions can be overloaded by change in number of
arguments or/and change in type of arguments.
2. Run-time Polymorphism- It is also known as Dynamic Method Dispatch. It is a process
in which a function call to the overridden method is resolved at Runtime. This type of
polymorphism is achieved by Method Overriding. Overriding, on the other hand, occurs
when a derived class has a definition for one of the member functions of the base class.
That base function is said to be overridden.

JAVA PACKAGES:

A package in Java is used to group related classes. It is like a folder in a file directory. We
use packages to avoid name conflicts, and to write a better maintainable code.
Packages are divided into two categories:

 Built-in Packages -packages from the Java API

 User-defined Packages -create your own packages

We can add more classes to a created package by using package name at the top of the
program and saving it in the package directory. Packages that are inside another
package are the sub packages. These are not imported by default; they have to
imported explicitly. Also, members of a sub package have no access privileges, i.e., they
are considered as different package for protected and default access specifiers.

I/O FUNCTIONS:

An I/O stream/function represents an input source or an output destination. A stream can


represent many different kinds of sources and destinations, including disk files, devices, other
programs, and memory arrays. Streams support many different kinds of data, including simple
bytes, primitive data types, localized characters, and objects. Some streams simply pass on
data; others manipulate and transform the data in useful ways. No matter how they work
internally, all streams present the same simple model to programs that use them: A stream is a
sequence of data. A program uses an input stream to read data from a source, one item at a
time. A program uses an output stream to write data to a destination, one item at time. Java
provides strong but flexible support for I/O related to files and networks. Few examples:

1. System.in-This is the standard input stream that is used to read characters from
the keyboard or any other standard input device.

2. System.out-This is the standard output stream that is used to produce the result of
a program on an output device like the computer screen.
CHAPTER 3

DESIGN GOALS

ALGORITHM:

Step 1: Select the GUI JFrame in the options available in the software NetBeans IDE 7.2.
This enables one to create design (on the front-end) and the code or the action to be
performed (on the back-end).

Step 2: On the front end, the page or the JFrame is to be designed according to the
requirements by the coder in order to get the inputs from the user. Later, on the
back end the coder has to write code using the packages and the input/output
functions in order to get the desired output.

Step 3: At the start of the project there will be an introduction page once the user executes
the program. Later the user will be asked to select a button (sign-up or login).
According to the user’s choice the respective action/event handler will get invoked.
Further the sign-up or the login page (a separate JFrame for both has to be created
and then joined using object references).

Step 4: In the sign-up page the user has to enter the details if the user is a first-time user.
Once the user has entered all the data in the required fields correctly, the data is
then stored in one of the databases in MySQL Server Client. On storing the data
there are two uses: firstly, the data is referred again in the login page and secondly it
can be used to display or modify the data. At the back-end the code has to been
written in order to connect with the MySQL Server Client. The driver of that
particular command line client has to be added in the java package. The connection
with the MySQL client has to be tested by writing the root password and the
username. Thus, a database connection active link will be shown in the tab of the
database in NetBeans.

Step 5: Once the user has finished the step of the registration or storing their data in the
MySQL database, the user will be directed to the login page where one has to enter
the registered password and username. Once the password matches the one in the
database the user can further choose her preferences. Based on a variety of choices,
the user has to select their choice and then the pages/JFrames are created according
to the criteria set by the user. So, the filters are to be chosen and then the user is
displayed with the desired result.

Step 6: The users have an option to create their own application to a specific university or
simply a course which they want to apply in. For this a separate JFrame is created
and fields are used for the user to input the required information. This reduces the
long procedures which one has to undergo to get enrolled or place an order
according to their preference.
FLOWCHART:

By Woman For Women

Sign-Up Login

Based on the username and password the user will be directed to the respective page
Enter basic details like: 1.Name
2.Age
3.E-mail address 4.Phone number 5.Profession
6.Category

Selected profession page will be opened.

Login in that particular profession will be opened if a form or application has to be sent for a univer
CHAPTER 4

IMPLEMENTATION

MODULE 1:

This module of the mini project includes implementation of ServerSocket in Java.


Below is the Java source code for the server socket implementation.

package server;
import data.Data;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
public class Server extends javax.swing.JFrame {
public Server() {
initComponents();
}
private ServerSocket server;
private ObjectOutputStream out;
private ObjectInputStream in;
private DefaultListModel mod = new DefaultListModel();
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
list.setModel(mod);
new Thread(new Runnable() {
@Override
public void run() {
try {
server = new ServerSocket(9999);
t.append("SERVER STARTED ...\n");
Socket s = server.accept();
in = new ObjectInputStream(s.getInputStream());
Data data = (Data) in.readObject();
String name = data.getName();
txt.append("The client has been successfully connected ...\n");
while (true) {
data = (Data) in.readObject();
mod.addElement(data);
txt.append("Received 1 file ... \n");

} catch (Exception e) {
JOptionPane.showMessageDialog(Server.this, e, "Error",
JOptionPane.ERROR_MESSAGE);
}

}
}).start();
}

MODULE 2:

This module of the implementation of the mini project consists of the available variety
of professions given to the user as a choice. Each of the profession pages consists of
basic three options which are: courses, admissions or orders (for chefs). This module
requests the user to choose what they want to pursue or apply for further. This module
ensures that the user has variety of options to choose their preference. For example, in
the Chef’s page one will find the following options: create an order, view orders, place
an order or available courses. Similarly, if one selects their profession to be a sports
person then the user will be able to view options like nearby sports centres or training
institutions.

package client;
import data.Data;
import java.io.File;
import java.io.FileInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
public class Client extends javax.swing.JFrame {
public Client() {
initComponents();
}
private Socket socket;
private ObjectOutputStream out;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
socket = new Socket(txtIp.getText().trim(), 9999);
txt.append("CONNECTED SUCCESSFULLY ...\n");
out = new ObjectOutputStream(socket.getOutputStream());
Data data = new Data();
data.setStatus("new");
data.setName("Dency");
out.writeObject(data);
out.flush();
} catch (Exception e) {
JOptionPane.showMessageDialog(this, e, "Error", JOptionPane.ERROR_MESSAGE);
}
}
1. Thereby, a wholesome opportunity for her to pursue her aspiration is enabled on
this platform through this module.

MODULE 3:

This module includes the connection of the Java platform with the MySQL Server. This
enables the user to display as well as edit the information given. Through the MySQL
Server, a database is created in which the data given by the user is stored in the form of
table further in the form of records. By using simple MySQL queries, the desired record
of the user’s information will be displayed or edited. These queries are written in the
MySQL format but executed in the Java JFrame. A connection is established with the
server with the help of few lines of code which is written in Java. Also, the driver is
imported to the main project in order to test the connection with the server.
1. This part of the code will store the data entered by the user during the sign-up
page into the MySQL Server Client. As the data entered will be stored it will be
beneficial for login which is another important implementation in this mini
project.
2. If the user wants to display their information about the details they have
entered they can view it through the view option which can only be
implemented through this connection.

MODULE 4:

This module displays the desired output to the user. Based on the profession and the
criteria the user selects, the information is displayed. If any user wants to generate an
application to a particular university or an organisation she can do so. The user can
create a request in her field of interest with ease by cutting down the long procedures
of enrolling oneself in a particular university or an organisation. Also, the user can apply
filters based on their preferences.
CHAPTER 5

RESULTS

RESULT VERIFICATION OF INHERITANCE


RESULT VERIFICATION OF POLYMORPHISM
CHAPTER 6

CONCLUSION

It has always been a challenge for the women of any nation or of any profession to strike
the correct balance between being the most important member of the family and leading
her professional goals. This field of women empowerment has always been an ambiguity.
However, through this mini project I would like to bring about a significant change in order
to enable the millions of homemakers to start achieving what they had to miss during their
most challenging times. This not only benefits the homemakers but also the organisations
which are on day-to-day basis looking for people having the skills set and the capability to
give justice to their jobs.
CHAPTER 7

REFERENCES

BOOKS:
1. Informatics Practices by Sumita Arora
2. Java: A Beginner’s Guide by Herbert Schildt

SITES:
1. geeksforgeeks
2. GitHub

You might also like