You are on page 1of 70

Corporate Connections

CHAPTER-1
1. INTRODUCTION
This project CORPORATE CONNECTIONS is an
online website in which jobseekers can see the
complete information regarding any company they want
to peruse corporate connections provides online help to
users all over the world. In this user can get all the
information regarding the company like it's workplace
environment, opinions of present workers, and ex-
workers, all the pros and cons including the information
present at Wikipedia like when founded, founder.
revenue etc. Instead of searching on different websites
user can explore about a company using this single
website and find the job which best suits to the user.
Those who want to get updated about their workplace
before joining or want to set target for their dream job
or want to know about new company from here the
planning begins and it is the best suited place to begin
with. Corporate Connections enable the users to add on
reviews and their opinion by registering themselves. It
resolves the issue of fakeness among the upgrading
industries and to maintain crystal clear image of the
company for inside and outside world which will
maintain the enthusiasm among the fresher’s and
jobseekers. Each company register itself and can add on
fresh notification about their upcoming events or any
job recruitment in the company. This multiplatform
solution brings in by default the basic intelligence and
immense possibilities for further extension of the
application as required by the users. The system make it
friendly to distribute, share and manage the companies
with higher efficiency and easiness. The objective of
this website is serve as a common meeting ground for
jobseekers and employers, both locally and globally
where candidates can find their green jobs and recruiter

1
Corporate Connections

find the right candidate to fulfill their needs.


Specifically designed for most dynamic employers.
1.1 ABSTRCAT
This project is aimed at developing and interface for
company, registering its details taking it basic
information’s on any notification to be updated. Users
can see all the information’s regarding the company.
Module in this project
1. Administrator
2. Users
3. Company
Brief description on the modules:
1. Administrator: Administrator has the full
authority over the website. He can view all
the registered users and have the power to
delete them. He can edit the web pages and
update them. He can view all the company
details also.
2. Users : User can view all the companies
details, work place pictures, reviews. Can
add reviews and up load pictures on their
behalf.
3. Company: the company can register itself,
add notification, updates its profile
accordingly.

2
Corporate Connections

CHAPTER-2

2. SYSTEM ANALYSIS
2.1 DEFINITION
System Analysis is the detailed study of the various
operations performed by the system and their
relationships within and outside the system. Analysis is
the process of breaking something into its parts so that
the whole may be understood. System analysis is
concerned with becoming aware of the problem,
identifying the relevant and most decisional variables,
analyzing and synthesizing the various factors and
determining an optional or at least a satisfactory
solution. During this a problem is identified, alternate
system solutions are studied and recommendations are
made about committing the resources used to the
system.
2.2 DESCRIPTION OF PRESENT SYSTEM
Presently to find information regarding company, for
its basic details we have to search Wikipedia, for details
like pros and cons, reviews regarding a company we
have to via other website.
2.3 LIMITIONS OF THE PRESENT SYSYTEM
Presently to find information this task of searching and
gathering information regarding a company is time
consuming and hectic work. This website is convenient
for job seekers and good at managing all companies
related data.
2.4 PROPOSED SYSTEM
Corporate Connections aimed at developing a web-
based centralized source of information regarding the
companies where companies whether upcoming or

3
Corporate Connections

existing can register themselves to update the users


about them. User get all the information regarding the
company from every source whether the information is
in favor or against the company but will be true and
clear which gives a clear image regarding a company in
the mind of the jobseeker.

2.5 LOGICAL DESIGN


Logical data design is about the logically implied data.
Each and every data in the form can be designed in
such a manner to understand the meaning. Logical data
designing should give a clear understanding & idea
about the related data used to construct a form.
Data flow diagram
A Data Flow Diagram (DFD) is a diagram that
describes the flow of data and the processes that change
or transform data throughout a system. It’s a structured
analysis and design tool that can be used for
flowcharting in place of, or in association with,
information oriented and process oriented system
flowcharts. When analysts prepare the Data Flow
Diagram, they specify the user needs at a level of detail
that virtually determines the information flow into and
out of the system and the required data resources. This
network is constructed by using a set of symbols that do
not imply a physical implementation. The Data Flow
Diagram reviews the current physical system, prepares
input and output specification, specifies the
implementation plan etc.
Four basic symbols are used to construct data flow
diagrams. They are symbols that represent data source,
data flows, and data transformations and data storage.
The points at which data are transformed are

4
Corporate Connections

represented by enclosed figures, usually circles, which


are called nodes.
Data Flow Diagram Symbols:-
_
Source or Destination of data
_
Data Flow

_
Process

_
Storage

Steps to Construct Data Flow Diagrams


Four steps are commonly used to construct a DFD

 Process should be named and numbered for


easy reference. Each name should be
representative of the process.
 The direction of flow is from top to bottom and
from left to right.
 When a process is exploded into lower level
details they are numbered.
 The names of data stores, sources and
destinations are written in capital letters.
Rules for constructing a Data Flow Diagram

 Arrows should not cross each other.


 Squares,Circles and files must bear names.

5
Corporate Connections

 Decomposed data flow squares and circles can


have same names.
 Choose meaningful names for dataflow.
 Draw all data flows around the outside of the
diagram.

6
Corporate Connections

CHAPTER-3
3.1. TABLE SPECIFICATION:
Figure3.1.1: Review

Database

Figure3.1.2-SignUp

7
Corporate Connections

Figure3.1.3-Wall

8
Corporate Connections

CHAPTER-4

4. OVERVIEW OF LANGUAGE USED


4.1 ABOUT J2EE & MICROSOFT ACCESS
4.1.1 JAVA
Java is a small, simple, safe, object oriented, interpreted
or dynamically optimized, byte coded, architectural,
garbage collected, multithreaded programming
language with a strongly typed exception-handling for
writing distributed and dynamically extensible
programs.
Java is an object oriented programming language. Java
is a high-level, third generation language like C,
FORTRAN, Small talk, Pearl and many others. You can
use java to write computer applications that crunch
numbers, process words, play games, store data or do
any of the thousands of other things computer software
can do.
Special programs called applets that can be downloaded
from the internet and played safely within a web
browser. Java a supports this application and the follow
features make it one of the best programming language.
 It is simple and object oriented
 It helps to create user friendly interfaces.
 It is very dynamic.
 It supports multithreading.
 It is platform independent
 It is highly secure and robust.
 It supports internet programming

Java is a programming language originally developed


by Sun Microsystems and released in 1995 as a core
component of Sun's Java platform. The language

9
Corporate Connections

derives much of its syntax from C and C++ but has a


simpler object model and fewer low-level facilities.
Java applications are typically compiled to byte code
which can run on any Java virtual machine (JVM)
regardless of computer architecture.

The original and reference implementation Java


compilers, virtual machines, and class libraries were
developed by Sun from 1995. As of May 2007, in
compliance with the specifications of the Java
Community Process, Sun made available most of their
Java technologies as free software under the GNU
General Public License. Others have also developed
alternative implementations of these Sun technologies,
such as the GNU Compiler for Java and GNU
Classpath.

The Java language was created by James Gosling in


June 1991 for use in a set top box project. The language
was initially called Oak, after an oak tree that stood
outside Gosling's office - and also went by the name
Green - and ended up later being renamed to Java, from
a list of random words. Gosling's goals were to
implement a virtual machine and a language that had a
familiar C/C++ style of notation.

4.1.2 PRIMARY GOALS

There were five primary goals in the creation of the


Java language:

1. It should use the object-oriented programming


methodology.
2. It should allow the same program to be executed
on multiple operating systems.

10
Corporate Connections

3. It should contain built-in support for using


computer networks.
4. It should be designed to execute code from
remote sources securely.
5. It should be easy to use by selecting what were
considered the good parts of other object-
oriented languages.

4.2 OVERVIEW OF J2EE

Today more and more developments want to write


distributed transactional applications for the enterprise
and leverage the speed, security and reliability of server
side technology. J2EE is a platform independent, java
centric environment from sun for developing, building
and deploying web based enterprise application online.
The J2EE platform consists of a set of services, API’s
and protocols that provide functionality for developing
multi-tiered web based application.

At the client side tier, J2EE supports pure HTML as


well as java applets or applications. It relies on JSP and
Servlet codes to create HTML or other formatted data
for the client. EJB provide another layer where the
platform’s logic is stored. An EJB server provides
functions such as threading, concurrency, security and
memory management. To reduce costs and fast-track
enterprise application design and development, the
java2 platform, Enterprise edition (J2EE) technology
provides a component-based approach to the design,
development, assembly and distributed application
model, the ability to reuse components, integrated
Extensible Markup Language (XML) based data
interchange, a unified security model, and flexible
transaction control.

11
Corporate Connections

4.3 DISTRIBUTED MULTI TIERED


APPLICATIONS
The J2EE platform uses a multi tiered distributed
application model. Application logic is divided into
components according to function, and the various
application components that make up a J2EE
application are installed on different machines
depending on the tier in the multi tiered J2EE
environment to which the application component
belongs. The figure shown below shows two multi
tiered j2EE applications divided into the tiers described
in the following list. The J2EE application parts shown
in Figure
 Client-tier components run on the client machine.
 Web-tier components run on the J2EE server.
 Business-tier components run on the J2EE server.
Enterprise information system (EIS)-tier software
runs the EIS server.

12
Corporate Connections

CHAPTER-5
5.1 J2EE COMPONENTS
J2EE applications are made up of components. A J2EE
component is a self-contained functional software unit
that is assembled into a J2EE application with its
related classes and files and that following J2EE
components: Application clients and applets are
components that run on the client.

 Java Servlet and Java Server Pages (JSP)


technology components are Web components that
run on the server.
 Enterprise Java Beans (EJB) components are
business components that run on the server.
J2EE components are written in the java
programming language and are compiled in the
same way as any program in the language. The
difference between J2EE components and standard
java classes is that J2EE components are assembled
into a J2EE application. Verified to be well formed
and in compliance with managed by the J2EE
server.
5.2 J2EE CONTAINERS
Normally, thin-client multi tiered applications are hard
to write because they involve many lines of intricate
code to handle transaction and state management,
multithreading, resource pooling, and other complex
low-level details. The component-based and platform-
independent J2EE architecture makes J2EE applications
easy to write because business logic is organized into
reusable components. In addition, the J2EE server

13
Corporate Connections

provides underlying services in the form of a container


for every component type. Because you do not have to
develop these services yourself, you are free to
concentrate on solving the business problem at hand.
Containers provide the runtime support for J2EE
application components.
Containers provide a federated view of the underlying
J2EE APIs to the application components. J2EE
application components never interact directly with
other J2EE application components. They use the
protocols and methods of the container for interacting
with each other and with platform services. Interposing
a container between the application components and the
J2EE services allows the container to transparently
inject the services defined by the components
deployment descriptors, such as declarative transaction
management, security checks, resource pooling, and
state management. A typical J2EE product will provide
a container for each application component type:
application client container, applet container, web
component container, and enterprise bean container.
5.3 J2EE SERVER
It is a runtime portion of a J2EE product. A J2EE server
provides EJB and Web containers. The component-
based and platform-independent J2EE architecture
makes J2EE applications easy to write because business
logic is organized into reusable components and the
J2EE server provides underlying services in the form of
a container for every component type.

5.4 CONTAINERS AND SERVICES

14
Corporate Connections

Components are installed in their containers during


deployment and are the interface between a component
and the low-level platform-specific functionality that
supports the component. Before a web, enterprise bean,
or application client component can be executed, it
must be assembled onto a J2EE application and
deployed into its container. The assembly process
involves specifying container settings for each
component in the J2EE application and for the J2EE
application itself. Container settings customize the
underlying support provided by the J2EE Server, which
include services such as security, transaction
management, Java Naming and Directory Interface
(JNDI) lookups, and remote connectivity. Here are
some of the highlights:

 The J2EE security model lets you configure a web


component or enterprise bean so system resources
are accessed only by authorized users.
 The J2EE transaction model lets you specify
relationships among methods that make up a single
transaction so all methods in one transaction are
treated as a single unit.
 JNDI lookup services provide a unified interface to
multiple naming and directory services in the
enterprise so application components can access
naming and directory services.
 The J2EE remote connectivity model manages low-
level communications between clients and
enterprise beans. After an enterprise bean is created,
a client invokes methods on it as if it were in the
same virtual machine.

5.5 J2EE PLATFORM ROLES

15
Corporate Connections

The J2EE platform also defines a number of distinct


roles that are performed during the application
development and deployment life cycle:

 The product provider designs and offers the


J2EE platform, APIs, and other features that are
defined in the J2EE specification for purchase.
 The tool provider offers tools that are used for
the development and packaging of application
components as part of the J2EE specifications.
 The application component provider creates
Web components, enterprise beans, applets, or
application clients to use in J2EE applications.
 The application assembler takes a set of
components that are developed by component
providers and assembles them in the form of an
enterprise archive (EAR) file.
 The deployer is responsible for deploying an
enterprise application into a specific operational
environment that corresponds to a J2EE
platform product.
 The system administrator is responsible for the
operational environment in which the
application runs.
Product providers and tool providers have a product
focus. Application component providers and application
assemblers focus on the application. Deployers and
system administrators focus on providing the J2EE
application with platform-specific artifacts, and on the
platform run time.
These roles help identify the tasks and people involved.
Understanding this separation of roles is important
because it helps to determine the approach when
developing and deploying J2EE applications.

16
Corporate Connections

5.6 J2EE BENEFITS


The J2EE specification provides customers a standard
which can be used to ensure investment protection
when purchasing or developing applications.
Comprehensive, independent Compatibility Test Suites
ensure vendor compliance with J2EE standards.
Some benefits of deploying to J2EE architecture
include:
 A simplified architecture that is based on
standard components, services, and clients. The
architecture maximizes the write-once, run-
anywhere Java technology.
 Services providing integration with existing
systems, including Java DataBase Connectivity
(JDBC); Java Message Service (JMS); Java
Connector Architecture (JCA); Java Interface
Definition Language (Java IDL); the JavaMail
API; and Java Transaction API (JTA and JTS) for
reliable business transactions.
 Scalability to meet demand, by distributing
containers across multiple systems and using
database connection pooling, for example.
 A better choice of application development
tools and components from vendors providing
standard solutions.
 A flexible security model that provides single
sign-on support, integration with legacy
security schemes, and a unified approach to
securing application components.

5.7 SYSTEM SPECIFICATION


5.7.1 Hardware Specification:-

17
Corporate Connections

 Operating System: Windows XP/7/8 , Linux,


Mac
 Processor: Intel dual core or above

 Processor Speed:2.0GHZ or above

 RAM: 2 GB RAM or above

 Hard Disk: 20 GB hard disk or above

5.7.2 Software Specification:-

 Front End: Java/J2EE

 Back End: Oracle Database

 Platform: Eclipse

 Server: Apache Tomcat

18
Corporate Connections

CHAPTER-6
6. APPENDIX
6.1 SCREEN LAYOUT
Figure 6.1.1 About

Figure-6.1.2 Workplace

19
Corporate Connections

Figure6.1.3 Reviews

Figure6.1.4 Notification Wall

20
Corporate Connections

Figure6.1.5 Companies Sign Up

21
Corporate Connections

Figure6.1.6 Companies Interface

Figure6.1.7 Sign In

Figure6.1.8 Add Review

22
Corporate Connections

6.2 SOURCE CODE


Struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts
Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<!-- START SNIPPET: xworkSample -->
<struts>
<package name="default" extends="struts-default">
<action name="register" class="Sign_up" >
<result name="success">home.jsp</result>

23
Corporate Connections

<result name="input">doit.jsp</result>
</action>
<action name="signin" class="Sign_in" >
<result name="success">home1.jsp</result>
<result name="failure">signIn.jsp</result>
<result name="input">signIn.jsp</result>
</action>
<action name="update" class="update">
<result name="success">logout.jsp</result>
<result name="input">/update.jsp</result>
</action>
<action name="newpassword" class="newpassword">
<result name="success">logout.jsp</result>
<result name="input">newpassword.jsp</result>
</action>
<action name="wallpost" class="Wall">
<result name="success">logout.jsp</result>
<result name="input">wallpost.jsp</result>
</action>
<action name="logout" class="logout">
<result name="success">index.jsp</result>
</action>

24
Corporate Connections

<action name="first" class="MyAction" >


<result name="success">about.jsp</result>
<result name="failure">noresult.jsp</result>
<result name="input">index.jsp</result>
</action>
<action name="wall" class="MyAction3" >
<result name="success">wall.jsp</result>
<result name="failure">noresult.jsp</result>
<result name="input">/index.jsp</result>
</action>
<action name="review" class="MyAction2" >
<result name="success">review.jsp</result>
<result name="failure">noresult.jsp</result>
<result name="input">/index.jsp</result>
</action>
<action name="addreview" class="MyAction4" >
<result name="success">review.jsp</result>
<result name="failure">noresult.jsp</result>
<result name="input">addreview.jsp</result>
</action>
</package>
</struts>

25
Corporate Connections

Sign _up.java
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import org.hibernate.classic.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.opensymphony.xwork2.ActionSupport;
@Entity
public class Sign_up extends ActionSupport {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
int id;
String
type,founded,key_people,headquarters,locations,service
s,revenue,no_of_employees,website,name,loc,password
;
public String getType() {
return type }
public String getFounded() {
return founded;
}

26
Corporate Connections

public String getKey_people() {


return key_people;
}
public String getHeadquarters() {
return headquarters;
}
public String getLocations() {
return locations;
}
public String getServices() {
return services;
}
public String getRevenue() {
return revenue;
}
public String getNo_of_employees() {
return no_of_employees;
}
public String getWebsite() {
return website;
}

27
Corporate Connections

public String getName() {


return name;
}
public String getLoc() {
return loc;
}
public String getPassword() {
return password;
}
public int getId() {
return id;
}
public void setType(String type) {
this.type = type;
}
public void setFounded(String founded) {
this.founded = founded;
}
public void setKey_people(String key_people) {
this.key_people = key_people;
}
public void setHeadquarters(String headquarters) {

28
Corporate Connections

this.headquarters = headquarters;
}
public void setLocations(String locations) {
this.locations = locations;
}
public void setServices(String services) {
this.services = services;
}
public void setRevenue(String revenue) {
this.revenue = revenue;
}
public void setNo_of_employees(String
no_of_employees) {
this.no_of_employees = no_of_employees;
}
public void setWebsite(String website) {
this.website = website;
}
public void setName(String name) {
this.name = name;
}
public void setLoc(String loc) {

29
Corporate Connections

this.loc = loc;
}
public void setPassword(String password) {
this.password = password;
}
public void setId(int id) {
this.id = id;
}
@Override
public String execute() throws Exception {
Sign_up obj= new Sign_up();
obj.setType(type);
obj.setFounded(founded);
obj.setKey_people(key_people);
obj.setHeadquarters(headquarters);
obj.setLocations(locations);
obj.setServices(services);
obj.setRevenue(revenue);
obj.setNo_of_employees(no_of_employees);
obj.setWebsite(website);
obj.setName(name);
obj.setLoc(loc);

30
Corporate Connections

obj.setPassword(password);
SessionFactory sf= new
Configuration().configure().buildSessionFactory();
Session ses= sf.openSession();
ses.beginTransaction();
ses.save(obj);
ses.getTransaction().commit();
return "success";
}
}
SignIn.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
public class Sign_in extends ActionSupport implements
SessionAware {
String
name,location,type,founded,key_people,headquarters,lo
cations,services,revenue,no_of_employees,website,id,p
assword;

31
Corporate Connections

Map<String, Object> session;


public String getLocation() {
return location;
}
public String getType() {
return type;
}
public String getFounded() {
return founded;
}
public String getKey_people() {
return key_people;
}
public String getHeadquarters() {
return headquarters;
}
public String getLocations() {
return locations;
}
public String getRevenue() {
return revenue;
}

32
Corporate Connections

public String getNo_of_employees() {


return no_of_employees;
}
public String getWebsite() {
return website;
}
public void setLocation(String location) {
this.location = location;
}
public void setType(String type) {
this.type = type;
}
public void setFounded(String founded) {
this.founded = founded;
}
public void setKey_people(String key_people) {
this.key_people = key_people;
}
public void setHeadquarters(String headquarters) {
this.headquarters = headquarters;
}
public void setLocations(String locations) {

33
Corporate Connections

this.locations = locations;
}
public void setRevenue(String revenue) {
this.revenue = revenue;
}
public void setNo_of_employees(String
no_of_employees) {
this.no_of_employees = no_of_employees;
}
public void setWebsite(String website) {
this.website = website;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public String getPassword() {

34
Corporate Connections

return password;
}

public void setName(String name) {


this.name = name;
}
public void setPassword(String password) {
this.password = password;
}
public String getServices() {
return services;
}
public Map<String, Object> getSession() {
return session;
}
public void setServices(String services) {
this.services = services;
}
@Override
public String execute() throws Exception {
Class.forName("oracle.jdbc.driver.OracleDriver");

35
Corporate Connections

Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@
localhost:1521:xe","SYSTEM","oracle");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from Sign_up
where name='"+(name)+"' and
password='"+password+"'");
if(rs.next())
{
id=rs.getString(1);
name=rs.getString(7);
type=rs.getString(12);
founded=rs.getString(2);
key_people=rs.getString(4);
headquarters=rs.getString(3);
locations=rs.getString(6);
services=rs.getString(11);
revenue=rs.getString(10);
no_of_employees=rs.getString(8);
website=rs.getString(13);
session.put("id", id);
session.put("name", name);
session.put("founded", founded);
session.put("key_people", key_people);

36
Corporate Connections

session.put("headquarters", headquarters);
session.put("services", services);
session.put("revenue", revenue);
session.put("no_of_employees", no_of_employees);
session.put("website", website);
session.put("locations", locations);
System.out.println("done ");
return "success";
}
else
return "failure";
}
@Override
public void setSession(Map<String, Object> arg0) {
// TODO Auto-generated method stub
session=arg0;
}
}
Update.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

37
Corporate Connections

import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
public class update extends ActionSupport implements
SessionAware {
String
type,founded,key_people,headquarters,locations,service
s,revenue,no_of_employees,website,name,loc,password
,id;
Map<String, Object> session;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public String getFounded() {
return founded;
}
public String getKey_people() {
return key_people;

38
Corporate Connections

}
public String getHeadquarters() {
return headquarters;
}
public String getLocations() {
return locations;
}
public String getServices() {
return services;
}
public String getRevenue() {
return revenue;
}
public String getNo_of_employees() {
return no_of_employees;
}
public String getWebsite() {
return website;
}
public String getName() {
return name;
}

39
Corporate Connections

public String getLoc() {


return loc;
}
public String getPassword() {
return password;
}
public void setType(String type) {
this.type = type;
}
public void setFounded(String founded) {
this.founded = founded;
}
public void setKey_people(String key_people) {
this.key_people = key_people;
}
public void setHeadquarters(String headquarters) {
this.headquarters = headquarters;
}
public void setLocations(String locations) {
this.locations = locations;
}
public void setServices(String services) {

40
Corporate Connections

this.services = services;
}
public void setRevenue(String revenue) {
this.revenue = revenue;
}
public void setNo_of_employees(String
no_of_employees) {
this.no_of_employees = no_of_employees;
}
public void setWebsite(String website) {
this.website = website;
}
public void setName(String name) {
this.name = name;
}
public void setLoc(String loc) {
this.loc = loc;
}
public void setPassword(String password) {
this.password = password;
}
@Override

41
Corporate Connections

public String execute() throws Exception {


Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@
localhost:1521:xe","SYSTEM","oracle");
Statement st=con.createStatement();
setId((String) session.get("id"));
int i=st.executeUpdate("update Sign_up set
type='"+type+"', locations='"+locations+"',
services='"+services+"', founded='"+founded+"',
no_of_employees='"+no_of_employees+"',
headquarters='"+headquarters+"',
key_people='"+key_people+"', revenue='"+revenue+"',
website='"+website+"' where id='"+id+ "'");
if(i>0)
{
return "success";
}
else
{
return "failure";

}
}

42
Corporate Connections

@Override
public void setSession(Map<String, Object> arg0) {
// TODO Auto-generated method stub
session=arg0;
}
}
Newpassword.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
public class newpassword extends ActionSupport
implements SessionAware {
String name,password,id;
Map session;
public String getId() {
return id;
}
public void setId(String id) {

43
Corporate Connections

this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String execute() throws Exception {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@
localhost:1521:xe","SYSTEM","oracle");
Statement st=con.createStatement();
setId((String) session.get("id"));
System.out.println("id"+id);

44
Corporate Connections

int i=st.executeUpdate("update Sign_up set


password='"+password+"' where id='"+id+"'");
if(i>0)
return "success";
else
return "failure";
}
@Override
public void setSession(Map<String, Object> arg0) {
// TODO Auto-generated method stub
session=arg0;
}}
Logout.java
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
public class logout extends ActionSupport implements
SessionAware {
Map<String, Object> session;

public String execute(){


if(session!=null)
{session.isEmpty();

45
Corporate Connections

return "success";
}
else
return "failure";
}
@Override
public void setSession(Map<String, Object> arg0) {
// TODO Auto-generated method stub
session=arg0;
}}
About.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

46
Corporate Connections

@SuppressWarnings("serial")
public class MyAction extends ActionSupport
implements SessionAware{
Map<String, Object> session;
String
company,location,type,founded,key_people,headquarter
s,locations,services,revenue,employees,website,id;

public String getId() {


return id;
}

public void setId(String id) {


this.id = id;
}

public String getType() {


return type;
}

public void setType(String type) {


this.type = type;

47
Corporate Connections

public String getFounded() {


return founded;
}

public void setFounded(String founded) {


this.founded = founded;
}

public String getKey_people() {


return key_people;
}

public void setKey_people(String keypeople) {


this.key_people = keypeople;
}

public String getHeadquarters() {


return headquarters;
}

48
Corporate Connections

public void setHeadquarters(String headquarters) {


this.headquarters = headquarters;
}

public String getLocations() {


return locations;
}

public void setLocations(String locations) {


this.locations = locations;
}

public String getServices() {


return services;
}

public void setServices(String services) {


this.services = services;
}

public String getRevenue() {


return revenue;

49
Corporate Connections

public void setRevenue(String revenue) {


this.revenue = revenue;
}

public String getEmployees() {


return employees;
}

public void setEmployees(String employees) {


this.employees = employees;
}

public String getWebsite() {


return website;
}

public void setWebsite(String website) {


this.website = website;
}

50
Corporate Connections

public String getCompany() {


return company;
}

public void setCompany(String company) {


this.company = company.toLowerCase().trim();
}

public String getLocation() {


return location;
}

public void setLocation(String location) {


this.location = location.toLowerCase().trim();;
}
public void validate()
{
if(company.equals(""))
addFieldError("company"," Company name must
Required");
}
public String execute() throws
ClassNotFoundException, SQLException

51
Corporate Connections

{
System.out.println("c : "+company);
System.out.println("l : "+location);
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@
localhost:1521:xe","SYSTEM","oracle");
Statement st=con.createStatement();

System.out.println("ID = "+ session.get("id"));


setId((String) session.get("id"));
ResultSet rs=st.executeQuery("select * from Sign_up
where name='"+(company)+"'");
if(rs.next())
{
ResultSet rs1=st.executeQuery("select * from Sign_up
where name='"+(company)+"' and loc='"+location+"'");
if(!rs1.next())
location="";
}
else
return "failure";

if(location.equals(""))

52
Corporate Connections

{
rs=st.executeQuery("select headquarters from Sign_up
where name='"+(company)+"'");
if(rs.next())
location=rs.getString(1);
}

rs=st.executeQuery("select * from Sign_up where


name='"+(company)+"' and loc='"+location+"'");
if(rs.next())
{
id=rs.getString(1);
session.put("id", id);
System.out.println("ID : "+id);
}

rs=st.executeQuery("select * from Sign_up where


id='"+(id)+"'");
if(rs.next())
{
type=rs.getString(12);
founded=rs.getString(2);

key_people=rs.getString(4);

53
Corporate Connections

headquarters=rs.getString(3);
locations=rs.getString(6);
services=rs.getString(11);
revenue=rs.getString(10);
employees=rs.getString(8);
website=rs.getString(13);
location=rs.getString(5);
System.out.println("ID 2 : "+id);
return "success";
}
else
return "failure";

}@Override
public void setSession(Map<String, Object> arg0) {
session=arg0;
}}
Wall.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

54
Corporate Connections

import java.sql.Statement;
import java.util.ArrayList;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class MyAction3 extends ActionSupport
implements SessionAware{
Map<String, Object> session;

String id,message;

public String getMessage() {


return message;
}

55
Corporate Connections

public void setMessage(String message) {


this.message = message;
}

public String getId() {


return id;
}

public void setId(String id) {


this.id = id;
}

ArrayList<Wall> list=new ArrayList<Wall>();

public ArrayList<Wall> getList() {


return list;
}

public void setList(ArrayList<Wall> list) {


this.list = list;
}

56
Corporate Connections

public Map<String, Object> getSession() {


return session;
}

public String execute() throws


ClassNotFoundException, SQLException
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@
localhost:1521:xe","SYSTEM","oracle");
Statement st=con.createStatement();

System.out.println("ID = "+ session.get("id"));


setId((String) session.get("id"));
if(session.get("id")!=null)

{
System.out.println("IDee = "+ id);

ResultSet rs=st.executeQuery("select * from Wall


where id='"+(id)+"'");
while(rs.next())
{

57
Corporate Connections

Wall wall = new Wall();


wall.setMessage(rs.getString(2));
list.add(wall);
System.out.println("ID 2 : "+id);
}
return "success";
}
return "failure";
}
@Override
public void setSession(Map<String, Object> arg0) {
session=arg0;

}}

AddReview.java:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Map;

58
Corporate Connections

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class MyAction4 extends ActionSupport
implements SessionAware{

Map<String, Object> session;

public Map<String, Object> getSession() {


return session;
}

String estatus,years,rating,name,title,pros,cons,id;

public String getEstatus() {


return estatus;
}

59
Corporate Connections

public void setEstatus(String estatus) {


this.estatus = estatus;
}

public String getYears() {


return years;
}

public void setYears(String years) {


this.years = years;
}

public String getName() {


return name;
}

public void setName(String name) {


this.name = name;
}

public String getTitle() {


return title;

60
Corporate Connections

public void setTitle(String title) {


this.title = title;
}

public String getPros() {


return pros;
}

public void setPros(String pros) {


this.pros = pros;
}

public String getCons() {


return cons;
}

public void setCons(String cons) {


this.cons = cons;
}

61
Corporate Connections

public String getRating() {


return rating;
}

public void setRating(String rating) {


this.rating = rating;
}

public String getId() {


return id;
}

public void setId(String id) {


this.id = id;
}

public String execute() throws


ClassNotFoundException, SQLException
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@
localhost:1521:xe","SYSTEM","oracle");
setId((String) session.get("id"));

62
Corporate Connections

PreparedStatement st= con.prepareStatement("insert


into review values(?,?,?,?,?,?,?,?)");
st.setString(1, id);
st.setString(2, estatus);
st.setString(3, years);
st.setString(4, name);
st.setString(5, title);
st.setString(6, pros);
st.setString(7, cons);
st.setString(8, rating);

st.executeUpdate();
System.out.println("Add Review");
return "success";
}

@Override
public void setSession(Map<String, Object> arg0) {
session=arg0;
}
}

63
Corporate Connections

Review.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class MyAction2 extends ActionSupport


implements SessionAware {
/**
*
*/
private static final long serialVersionUID = 1L;

Map<String, Object> session;

64
Corporate Connections

String id,estatus,year,name,title,pros,cons,rating;

public String getEstatus() {


return estatus;
}

public String getYear() {


return year;
}

public String getName() {


return name;
}

public String getTitle() {


return title;
}

public String getPros() {


return pros;

65
Corporate Connections

public String getCons() {


return cons;
}

public String getRating() {


return rating;
}

public void setEstatus(String estatus) {


this.estatus = estatus;
}

public void setYear(String year) {


this.year = year;
}

public void setName(String name) {


this.name = name;
}

66
Corporate Connections

public void setTitle(String title) {


this.title = title;
}

public void setPros(String pros) {


this.pros = pros;
}

public void setCons(String cons) {


this.cons = cons;
}

public void setRating(String rating) {


this.rating = rating;
}

public String getId() {


return id;
}

public void setId(String id) {


this.id = id;

67
Corporate Connections

ArrayList<Review> list=new ArrayList<Review>();

public ArrayList<Review> getList() {


return list;
}

public void setList(ArrayList<Review> list) {


this.list = list;
}

public Map<String, Object> getSession() {


return session;
}

public String execute() throws


ClassNotFoundException, SQLException
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@
localhost:1521:xe","SYSTEM","oracle");

68
Corporate Connections

Statement st=con.createStatement();

System.out.println("ID = "+ session.get("id"));


setId((String) session.get("id"));
if(session.get("id")!=null)
{
System.out.println("IDee = "+ id);

ResultSet rs=st.executeQuery("select * from review


where id='"+(id)+"'");
while(rs.next())
{

Review review = new Review();


review.setEstatus(rs.getString(2));
review.setYear(rs.getString(3))
review.setName(rs.getString(4));
review.setTitle(rs.getString(5));
review.setPros(rs.getString(6));
review.setCons(rs.getString(7));
review.setRating(rs.getString(8));

69
Corporate Connections

list.add(review);
System.out.println("ID 2 : "+id);
System.out.println("good");
}
return "success";
}

return "failure";
}
@Override
public void setSession(Map<String, Object> arg0) {
session=arg0;

}
}

70

You might also like