Knowledge Base Management System
Chapter 1
Preliminary Investigation
1
Knowledge Base Management System
a. Organizational Overview
Organizational Chart
2
Knowledge Base Management
User
Admin
Knowledge Base Management System
b.Description of System
Suppose you have a query on a topic then you will go through many books
to find the answer or you will surf net for finding answer.
By reading book you can find answer for your query but it will take much
time to find the answer.
Similarly surfing on net will take less time to find the answer but on net also
it is very difficult to find the correct and relevant information from tones of information
available.
In my project a user can post a question as well as he can answer the
questions which are already asked.
3
Knowledge Base Management System
c.Limitations Of Present System
Present system is very time consuming. Searching exact information is very tedious task. Question and answer handle manually/orally.
4
Knowledge Base Management System
d. Proposed System
The proposed system is computerized and has been developed using advance language therefore it gives more facilities than present system. It provides quick access to any data. In this system user have to just enter the question then other user can answer to his question and he will get the relevant information in time. This reduces the workload of user and it is also a time saving process.
User can also view already asked question to get more information.Admin can generate several kinds of reports to get an idea which users is active and which are not.
Advantages of Proposed System:
It will save user time. User can get several response at a place. User can get information about several topic at a place.
So the computerized system is more suitable than the manual system.
5
Knowledge Base Management System
e.Feasibility Of Study
Feasibility study tells whether the system would be beneficial for the organization with respect to the requirements of the organization. Feasibility study is divided into the following phases.
Phase of Feasibility
Operational FeasibilityOperational feasibility is dependent on the human resources
available for the project and involves projecting whether the system will operate and be used once it is installed. The proposed system is according to the requirements of the Auto Fuel Technologies, and after when it will be implemented in the AFT, is likely to yield benefits for the whole Company. As the people are already familiar with using application programs like Microsoft office so, there is no chance of any sort of destructive resistance to the implementation of this project. It is mainly concerned with the availability of human resources for the project and it also tells whether the system would be operate-able after its deployment or not. If the project meets the needs of an organization then it is operationally feasible. The proposed system would be beneficial in this regard as it would be exactly according to the user requirements and will give the guarantee of complete data security. It will provide the end users with timely pertinent, accurate and usefully formatted information by making a full use of the available resources.
Technological feasibility
Technical feasibility is a measurement of the practicality of a specific technical solution and the availability of technical resources and expertise. Today, very little is technically impossible, consequently, technical feasibility looks at what is practical and reasonable. It is the measure of specific technical solutions and the availability of technical resources and expertise. In technical feasibility we see that the technology in which we are implementing the project provides data security, reliability, and ease of access. In Auto Fuel Technologies project we use Visual Studio.Net a powerful, Productive, and extensible programming environment. Vb.Net unlocks the door towards the development of projects. For Data Base we use SQL Server2000, which has power to hold the data for a heavy project. Technical feasibility addresses three major issues: Is the proposed technology or solution practical? Do we currently possess the necessary technology? Do we possess the necessary technical expertise, and is the schedule reasonable? Yes! Technical problems can be there if there is
6
Knowledge Base Management System no computer operator. So there should be a computer operator for correct working of the software. And different technical issues will be solved during the testing process. A large part of determining resources has to do with accessing technical feasibility. If existing systems cannot be added onto, then the next question becomes whether there is technology in existence that meets the specification.
Social Feasibility
With the deployment of the new system on one hand the organization got benefited but on the other hand it also affects the employees of the organization. Social Feasibility is done in order to check this effect. It checks whether the system affects the job of employees and how much it affects the employees. The social evaluation how the proposed system may improve the jobs and the working environment of those affected. Our proposed system will affect the staff of the organization. As only 8+ persons would be enough to run this system despite of many manual record keepers, but other persons would be accommodated on the other places as the organization is escalating and they need to hire new persons in order to meet the growing needs of the organization. So this proposed system will also socially feasible for the organization. We analyze the social costs of training and education, salary changes and other hidden costs arising from hostility, ignorance and fear. In AFT we have to see that the staff working in Auto Fuel Technologies has knowledge of how to use the technologies as well as user training to use the project.
Economical and Financial Feasibility
Economic feasibility is the measurement of the cost effectiveness of the project proposed system. The bottom line in many projects is economic feasibility. During the early phase of the perfect economic feasibility analysis amount little more judging whether the possible benefits of the solution or worthwhile. Costs are practically impossible to estimate at that stage because the end user requirements and alternative technical solutions have not been identified. However as soon as specific requirements have been identified, the analyst can weigh the cost and benefit of each alternate solution. This is called the cost and benefit analysis. It is the measure of cost effectiveness of a project. This is often calling cost and benefits analysis. So in economical feasibility we see what cost is required to implement the new system. In AFT Automation system we have to see what costs are involved. So we have to consider all the facts that are related to new system costs.
7
Knowledge Base Management System
FRONT END: JAVAWhat Is Java? Java is a computer programming language. It enables programmers to write computer instructions using English based commands, instead of having to write in numeric codes. It’s known as a “high-level” language because it can be read and written easily by humans. Like English, Java has a set of rules that determine how the instructions are written. These rules are known as its “syntax”. Once a program has been written, the high-level instructions are translated into numeric codes that computers can understand and execute.
Overview of Java Programming
Java is an object-oriented programming language developed by Sun Microsystems in the early 1990s. The language is very similar in syntax to C and C++ but, in techie terms, it has a simpler object model and fewer low-level facilities.
Why Choose Java?
Java was designed with a few key principles in mind:
Easy to Use:
The fundamentals of Java came from a programming language called c++. Although a powerful language, it was felt to be too complex in its syntax, and inadequate for all of Java's requirements. Java built on, and improved the ideas of c++, to provide a programming language that was powerful and simple to use.
Reliability
Java needed to reduce the likelihood of fatal errors from programmer mistakes. With this in mind, object-oriented programming was introduced. Once data and its manipulation were packaged together in one place, it increased Java’s robustness.
Secure:
As Java was originally targeting mobile devices that would be exchanging data over networks, it was built to include a high level of security. Java is probably the most secure programming language to date.
Platform Independent:
Programs needed to work regardless of the machine they were being executed on. Java was written to be a portable language that doesn't care about the operating system or the
8
Knowledge Base Management System hardware of the computer.
BACK END: ORACAL
What Is Oracle?
Oracle is a powerful relational database management system that offers a large feature set. Along with Microsoft SQL Server, Oracle is widely regarded as one of the two most popular full-featured database systems on the market today .Oracle is the leading commercial database available for many computing platforms
ORACLE OVERVIEW:
Oracle is a multi-user database management system - A software package specializing in managing a single, shared set of information among many concurrent users. Oracle is one of many database servers that can be plugged into a client/server equation. Oracle works to efficiently manage its resource, a database of information, among the multiple clients requesting and sending dta in the network.
Oracle has many important freatures that make it not only an exceptional database management system, but also an excellent database server choice for client/server computing. Oracle supports all major operating systems for both clients and servers, including MSDOS, NetWare, UnixWare, OS/2 and most Unix flavors. Oracle networking software, SQL*Net, also supports all major network communication protocols, including TCP/IP, SPX/IPX, Named Pipes and DEC-Net. Therefore, Oracle can be the link which joins the many data stores and networks throughout the heterogeneous computing systems prevalent in most corporations.
Why choose Oracle?
Oracle is the not the most elegant database, and it’s not always the fastest platform. Oracle rose to the pinnacle of the IT world on other virtues. Rather than wait for the end-user community to react to market changes, Oracle took a proactive approach and often introduced features far-ahead of the market demand
9
Knowledge Base Management System
f.Stakeholders
Stakeholders are anyone who has an interest in the project. Project stakeholders
are individuals and organizations that are actively involved in the project, or whose
interests may be affected as a result of project execution or project completion. They
may also exert influence over the project’s objectives and outcomes. The project
management team must identify the stakeholders, determine their requirements and
expectations, and, to the extent possible, manage their influence in relation to the
requirements to ensure a successful project.
The following are examples of project stakeholders:
1. Project Developers
Project Developers is one who develops software for customer. In my project I am the first stakeholder i.e. Project Developer
2. Project user Group
Project User group are those people who use the software on daily basis for the Project Customer. In my project users are the second stakeholders i.e. Project Group user.
3. Project Testers
Project Testers are those who test the software. In my project myself and my project guide are the third stakeholders i.e. Project Testers.
10
Knowledge Base Management System
Software Specification:
Front End Java
JDK 1.6 Update 17
Back End Oracle 10g
Database Driver JDBC ODBC Driver
Operating system Windows XP
Hardware Specification
Processor Pentium IV
RAM 512 MB
Free Hard Disk Space 2 GB
Network LAN
11
Knowledge Base Management System
g.Gantt Chart
12
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30WEEK
Phase Start date
Completion date
Preliminary investigationProject Finalization
10/06/2010
18/06/2010
Investigation of system requirement
19/06/2010
29/06/2010
System Analysis
30/06/2010
14/8/2010
System Design
15/8/2010
28/9/2010
Coding
Interface Coding
29/09/2010
15/10/2010
Database Connectivity
16/10/2010
30/10/2010
Validation Coding
31/10/2010
13/11/2010
Report Coding
14/11/2010
29/12/2010
ImplementationDeveloper Testing
5/12/2010
11/12/2010
Client Testing
13/12/2010
22/12/2010
User Testing
24/12/2010
29/12/2010
Project Delivery
30/12/2010
05/1/2011
Project Report SubmissionProject Report Hard Copy Checking
8/1/2011
13/1/2011
Project Submission
14/1/2011
18/1/2011
Knowledge Base Management System
Chapter 2
System Analysis
13
Knowledge Base Management System
a.Fact Findings
Introduction
The Current System is the manual one, hence is not speedy, accurate, efficient as well as time consuming. An essential part of the system analysis, which enables the developer to understand & the system correctly. It is undertaken to obtain details of the system. To understand the physical flow of the information through the current system. Collect various information through various fact finding techniques. Identify the procedural difficulties experienced by the user. Study the bottlenecks find out the redundant work being performed in the system.
Fact Finding Techniques Employed
1. InterviewsInformation was obtained from the employees at the organization by
interviewing them at the location and time convention both.
2. Document SearchingAn extensive study of existing document an official correspondence was done
to understand the present working status of organization.
14
Knowledge Base Management System
b.Event Table
Events Trigger Source Activity Response Destination
Creating new user
FillingForm User Submission
Of formAccountCreated
Admin
EnteringUsername &
Password
FillingUsername &
PasswordUser
OpeningHis
ProfileVisitedProfile
User
SubmittingQuestion
Doubt For this
QuestionUser Sending
QuestionQuestion
Send User
SubmittingAnswer
ReadQuestion User
SendingAnswer Answer send User
SubmittingFeedback User
Feedback User Sending
Feedback FeedbackSend User
Sign out UserSign out User Sign out Sign out User
Insert Subject
Request for Subject Admin Inserting
subjectSubjectInserted Admin
DeleteQuestion
Found IllegalQuestion Admin Deleting
QuestionQuestionDeleted Admin
c.Use Case Diagram
15
Knowledge Base Management System
Admin
Users
16
Manages Username & Password
Check user Profile
Create Own Account
Submit Question
Delete Question
Insert Subject
Visiting the profile
Submit Answer
Insert Feedback
Sign out
Knowledge Base Management System
d. Entity-Relationship Diagram
17
Admin
Users
Question Answer
Knowledge Base Management System
e.Activity Diagram
No
Yes
f.Class Diagram
18
Enter Username & password
Open User Profile
Invalid Username & password
Checking Profile
Open a Email site
Submitting Question
Submitting Answer
Submitting Feedback
Sign out
Knowledge Base Management System
Sends
Sends, Delete Sends, Delete Sends
g.Object Diagram
19
Question
Queid,Subjected,Quest,Username,Ques_time,
Adminregid,username ,passward ,
Delete(); Insert();
Userregid ,firstname,lastname,dob ,address,gender,username,passward,phoneno,qualification,college,
Insert();
Answer
queid ,answer ,username,ans_date ,
Knowledge Base Management System
Sends
Sends, Sends Delete Sends, Delete
h.Sequence Diagram
20
Question
1,3,What is Java?,satish,11/11 /2011,
Admin1,Admin ,admin ,
User2 ,Satish,Patil,2/1/1991,panvel,Male,satish,satish123,9969066562,Bsc,C.K.T.,
Answer
1,Java is Object OrientedLanguage ,satish,12/ 11/2011 ,
Knowledge Base Management System
User Administrator
1. User enter site name 2 . Display Login Form 3 User Enter Username & Password
4.Verification 5.Invalid
6.User Renter Username & Password 7.Verification 9.User Check 8.Display User Profile His Profile 10.Submitting 14.Submitting Question Question
11.Submitting 15.Submitting Answer Answer
12.Submitting Feedback 13.Sign out 16.Deleting Question
17.Inserting Subject
18. Sign Out
21
Knowledge Base Management System
i.Collaboration Diagram
14.Submitting 15. Submitting 16. Deleting Question Answer Question
7.Verification 17. Inserting Subject
4.Verification 18.Sign out
2. Display Login Form 3.User Enter Username & Password 5. invalid 6.User Renter Username & Password 8.Display User Profile 12.Submitting Feedback
1.User Enter 13.Sign out Site Name
9.User Check 10. Submitting 11.Submitting His Profile Question Answer
22
Administrator
User
Knowledge Base Management System
j.State Diagram
login
Invalid
Valid
Checking user profile
23
Submitting Question
Submitting Answer
Submitting Feedback
Ideal
Enter Username & password
Open User Profile
Sign out
Knowledge Base Management System
Chapter 3
System Design
24
Knowledge Base Management System
a.Converting ERD to Tables
NO. TABLE NAME PURPOSE
1 Newaccount This table is use to insert information about the user.The field are Firstname, Lastname, dob, address,Gender, Ph.no, Username, Password, Qualification, Collage,status.
2 Question This table is use to insert Question of the user.The field are Queid, Subjectid, Quest, Username, Questime.
3 Answer This table is use to insert Answer of the user.The field are Queid, Answer, Username, Ansdate.
4 Subject This table is use to insert Subject.The field are Subjectid, Subject.
5 Feedback
This table is use to insert Feedback of the user & Display It to Administrator.The field are Username, Feed, Feedtime
25
Knowledge Base Management System
b.Component Diagram
c.Package Diagram
26
account.jsp
newaccount.jsp
question.jsp
queans.jsp
queansall.jsp
answer.jsp
feedback.jsp
Knowledge BaseManagementSystem
homepage.jsp
quedelete.jsp
subject.jsp
allreport.jsp
studentreport.jsp
quereportdis.jsp
adminfeedback.jsp
Logout.jsp
Knowledge Base Management System
27
Knowledge BaseManagementSystem
Login
Users
account.jsp newaccount.jsp
question.jsp queans.jsp
queansall.jsp Logout.jsp
Admin
queansall.jsp
queans.jsp.question.jsp
Logout.jsp
feedback.jsp answer.jsp
answer.jsp
subject.jsp adminfeedback.jsp
quedelete.jsp allreport.jsp
studentreport.jsp
quereportdis.jsp
Knowledge Base Management System
d. Deployment Diagram
28
Database Server
LOCAL AREA NETWORK
HUB 1
Terminal Printer
account.jsp homepage.jsp
newaccount.jsp question.jsp
queans.jsp queansall.jsp
answer.jsp feedback.jsp
quedelete.jsp subject.jsp
allreport.jsp studentreport.jsp
quereportdis.jsp adminfeedback.jsp
Logout.jsp
HUB 2
Terminal Printer
Knowledge Base Management System
e.System Flow Chart
29
KnowledgeBaseManagementSystem
NewaccountMaintain UsersDetails
Question
Answer
Subject
Feedback
Maintain QuestionDetails
Maintain AnswerDetails
Maintain Subject Details
Maintain Feedback Details
Users report
Question report
Knowledge Base Management System
f.Structure Chart
30
Knowledge Base Management System
Newaccount Question
Get information about user
Put informationabout user
Answer Subject
Feedback
Get UsersQuestioninformation
Put Users Questioninformation
Get UsersAnswerinformation
Put UsersAnswerinformation
GetSubjectinformation
Put Subjectinformation
Get UsersFeedback information
Get UsersFeedback information
Knowledge Base Management System
Chapter 4
System Coding
31
Knowledge Base Management System
a.Menu Tree
32
Login Form
Question
Delete Question
My Question
Insert Subject
All Question
Feedback
Knowledge Base Management System
b.Table List
Table name : NewaccountDescription: the table stores the details of Users
Sr.No. Field Name Datatype Constraints Size Description 1 regid Number
IntegerPrimary key Stores the User’s ID
2 firstname Varchar2 20 Stores the User’s Firstname 3 lastname Varchar2 20 Stores the User’s Lastname
4 dob Date Stores the User’s Date. 5 address Varchar2 40 Stores the User’s Address 6 gender Varchar2 20 Stores the User’s Gender 7 username Varchar2 unique 20 Stores the User’s Username 8 passward Varchar2 not null 20 Stores the User’s Password 9 phoneno Varchar2 20 Stores the User’s Phone no. 10 qualification Varchar2 20 Stores the User’s Qualification
11 college Varchar2 20 Stores the User’s College 12 status Char 1 Stores the User’s Status
Table name : QuestionDescription: the table stores the details of Question
Sr.No Field Name Datatype Constraints Size Description 1 queid Number Primary key Stores the User’s Question Id 2 subjectid Number Foreign key Stores the SubjectId 3 quest Varchar2 2000 Stores the User’s Question
4 username Varchar2 20 Stores the User’s Username 5 ques_time Date Stores Question sending time
33
Knowledge Base Management System
Table name : AnswerDescription: the table stores the details of Answer
Sr.No Field Name Datatype Constraints Size Description 1 queid Number Foreign key Stores the User’s Question Id 2 answer Varchar2 2000 Stores the User’s Answer 3 username Varchar2 20 Stores the User’s Username 4 ans_date Date Stores Answer sending time
Table name : SubjectDescription: the table stores the details of Subject
Sr.No. Field Name Datatype Constraints Size Description 1 subjectid Number Primary key Stores the Subject id 2 subject Varchar2 20 Stores the Subject
Table name : FeedbackDescription: the table stores the details of Feedback
Sr.No. Field Name Datatype Constraints Size Description 1 username Varchar2 Stores the User’s Username 2 feed Varchar2 20 Stores the User’s Feedback 3 Feedtime Varchar2 2000 Stores Feedback Sending
time
34
Knowledge Base Management System
c. Program Description with naming conventions
Form List
Report List
NO. REPORT NAME PURPOSE
35
NO FORM NAME PURPOSE
1 Account.jsp This form is Provides the Login Page for security purpose
2 Newaccount.jsp This form is use to Add the new user account for security purpose
3 Homepage.jsp This is the main form under which all the child forms are opened.
4 Question.jsp This form is use for Insert users Question details
5 Queans.jsp This form is use for Display own Question details
6 Queansall.jsp This form is use for Display all users Questions details with subject wise
7 Answer.jsp This form is use for Insert users Answer
8 Feedback.jsp This form is use for Insert Users Feedback details
9 LogOut.jsp This form is use for Log out from Web site
10 Subject.jsp This form is use for Insert Subject details
11 Quedelete.jsp This form is use for Delete Questions
12 DeleteJSP.jsp This form is use for Delete Question details
13 Adminfeedback.jsp This form is use for Display Users Feedback details
14 news.jsp This form is used for display current event
15 about.jsp This form is used for display about project Developer
Knowledge Base Management System1 Quereportdis.jsp This report is use to
show the users Question2 studentreport.jsp This report is use to
show the users Details
36
Knowledge Base Management System
d.Program Description
Program Name: Account.jspProgram Function: This form is Provides the Login Page to Users for security purpose
Pseudo Code:
Sr. No. Name Procedure Description1 Submit Click Logs on to Home page2 Reset Click Reset the field
37
Knowledge Base Management System
Account.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>Account</title><link rel="stylesheet" type="text/css" href="css1.css" ></head>
<body ><form name="Loginpage" action="http://localhost:8090/kbm/servlet/Login" method="post"><div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center> <div id="Header" align=left> <font color=white>W W W.GENIUS ANSWER.COM</font> <div id="RightHeader"> </div></div> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="newaccount.jsp">Create New Account</a> </div> </div> <div id="Left" align=center> <div id="LeftMenu" align=center> <div class="LeftHeader" align=left><br><br><br> <table align=center><tr><td><B>Username:</b></td><td><input type=text name="username"></td></tr><tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr><td><b>Password:</b></td><td><input type=password name="passward"></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr> </table>
<table align=center><tr><td><font size=4><b>Roll:</b></font></td><td><select name="roll"><option value=S>Student</option> <option value=A>Admin</option></select></td></tr><tr><td></td></tr></table>
38
Knowledge Base Management System
<table align=center><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td><input type=submit value="Submit"></td><td></td><td></td><td></td><td></td><td></td><td><input type=reset value="Reset"></td></tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr> <% String val=(String)session.getAttribute("val");
if(val==null) out.println(" ");else if(val.equals("1")) out.println("<font size=5 color=yellow>
Your Registration Completed Succesfully</font>"); %> <% String value; String ID=request.getParameter("id");
session.setAttribute("val",ID); %> <% val=(String)session.getAttribute("Value");
if(val==null) out.println("");else if(val.equals("2"))
out.println("<font size=5 color='yellow'> Invalid Username or Password.</font>"); %></table> </div></div></div> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"><h2>Knowledge Base Management</h2><p class="Larger"><b>"Boosting Your Brainpower"</b></p> <p><I> Knowledge Base Management System</i> refers to a system for managing knowledge in organizations for supporting creation, capture, storage and dissemination of information. It can comprise a part of a Knowledge Management initiative.</p> <p> The idea of a KBMS system is to enable Users to have ready access to the organization's documented base of facts, sources of information, and solutions. Sharing this information organization wide can lead to more effective engine design and it could also lead to ideas for new or improved equipment.</p> <li><b>Purpose:</b> a KBMS will have an explicit Knowledge Management objective of some type such as collaboration, sharing good practice or the like</li>. <li><b>Context:</b> One perspective on KBMS would see knowledge is information that is meaningfully organized, accumulated and embedded in a context of creation and application.</li></div></div></div></div> <div id="Footer" align=center> <div id="Bottom" align=center> <span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div></form></body></html>
39
Knowledge Base Management System
Login.java
import java.io.*;import java.sql.*;import javax.servlet.*;import javax.servlet.http.*;
public class Login extends HttpServlet{public void doPost(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{PrintWriter out=res.getWriter();res.setContentType("text/html");Connection con=null;Statement stmt=null;ResultSet rs=null;HttpSession hs=null;try{ hs=req.getSession();String f=req.getParameter("username");String g=req.getParameter("passward");String h=req.getParameter("roll");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123");stmt=con.createStatement();rs=stmt.executeQuery("select count(*) from newaccount where Username='"+f+"' and passward='"+g+"' and status='"+h+"'" );rs.next();int n=rs.getInt(1);if(n==0){ res.sendRedirect("http://localhost:8090/kbm/account.jsp");hs.setAttribute("Value","2");}else{ hs.setAttribute("user",f); res.sendRedirect("http://localhost:8090/kbm/homepage.jsp"); }out.close();rs.close();con.close();stmt.close();}catch(Exception e){out.println("Error="+e);} }
40
Knowledge Base Management System
Program Name: newaccount.jspProgram Function: This form is use to Add the new user account
Pseudo Code:
Sr. No. Name Procedure Description1 Submit Click Create new account 2 Reset Click Reset the field
41
Knowledge Base Management System
Newaccount.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>newaccount</title><link rel="stylesheet" type="text/css" href="css1.css" ><script language="JavaScript" src="Valid.js"></script></head>
<body ><form name="newaccount" action="http://localhost:8090/kbm/servlet/newaccount" method="post"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left> <font color=white>W W W.GENIUS ANSWER.COM</font> <div id="RightHeader"> </div></div> <div id="Inter" align=center> <ul></ul></div> <div id="Menu" align=center> <a href="newaccount.jsp">Create New Account</a> <a href="account.jsp">Home</a> </div></div> <div id="Left" align=center> <div id="LeftMenu" align=center> <div class="LeftHeader" align=left> </div></div></div> <div id="Middle"> <div id="Page"> <div id="Content"> <div class="TopPart"> <table align=center><br><br> <tr><td><font size=3 color=white><b>First Name:</b></font></td> <td><input type=text name="firstname"onKeyPress="charOnly()"></td></tr> <tr><td></td></tr> <tr><td><FONT size=3 color=white><b>Last Name:</b></font></td> <td><input type=text name="lastname" onKeyPress="charOnly()"></td></tr> <tr><td></td></tr> <tr><td><font size=3 color=white><b>Birth Date:</b></font></td> <td><input type=text name="dob" onBlur="return ValidateForm()"></td></tr> <tr><td></td></ tr > <tr><td>< font size=3 color=white><b>Address:</b></font></td> <td><textarea name="address" rows=3 cols=18
42
Knowledge Base Management System onKeyPress="charOnly()"></textarea></td></tr><tr><td></td></tr><tr><td><font size=3 color=white><b>Gender:</b></font></td><td><input type=radio name="gender" value="Male">Male <input type=radio name="gender" value="Female">Female</td></tr><tr><td></td></tr><tr><td><font size=3 color=white><b>UserName:</b></font>< td><td><input type=text name="username"></td></tr><tr><td></td></tr><tr><td><font size=3 color=white><b>Enter Password:</b></font></td><td><input type=password name="passward"></td></tr><tr><td></td></tr><tr><td><font size=3 color=white><b>Reenter Password: </b></font></td><td><input type=password name="repassward" onblur="return confirmPass()"></td></tr><tr>< td ></ td ></ tr ><tr><td><font size=3 color=white><b>Phone No:</b></font></td><td><input type=text name="phoneno" maxlength=10 onKeyPress="numberOnly()"></td></tr><tr><td></td></tr><tr><td>< font size=3 color=white><b>Qualification :</b></font ></td ><td><SELECT name="qualification"><option value=SSC selected>SSC</option> <option value=HSC>HSC</option> <option value=BSc>BSc</option><option value=MSc>MSc</option ></SELECT></td></tr><tr><td></td></tr><tr><td><font size=3 color=white><b>College:</b></font></td><td><input type=text name="college" onKeyPress="charOnly()"></td></tr></table><table><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr></table><table align=center><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td><input type=submit value="Submit" onClick="return isEmpty()"></td ><td><input type=reset value="Reset"></td></tr></table>
</div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</form></body></html>
43
Knowledge Base Management System
Newaccount.java
import java.io.*;import java.sql.*;import javax.servlet.http.*;import javax.servlet.*;
public class newaccount extends HttpServlet{public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{PrintWriter out=res.getWriter();res.setContentType("text/html");
Connection con=null;Statement stmt=null;ResultSet rs=null;HttpSession hs=null;try{ hs=req.getSession();
String a=req.getParameter("firstname");String b=req.getParameter("lastname");String c=req.getParameter("dob");String d=req.getParameter("address");String e=req.getParameter("gender");String f=req.getParameter("username");String g=req.getParameter("passward");String h=req.getParameter("phoneno");String i=req.getParameter("qualification");String j=req.getParameter("college");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123");stmt=con.createStatement();
rs=stmt.executeQuery("select count(regid) from newaccount");rs.next();int reg=rs.getInt(1);rs.close();reg++;
int i1=stmt.executeUpdate("insert into newaccount values("+reg+",'"+a+"','"+b+"',to_date('"+c+"','dd/mm/yyyy'),'"+d+"','"+e+"','"+f+"','"+g+"','"+h+"','"+i+"','"+j+"','S')");
if(i1!=0) {
44
Knowledge Base Management Systemres.sendRedirect("http://localhost:8090/kbm/account.jsp");hs.setAttribute("val","1");}elseout.println("something wrong"); stmt.close();con.close();}catch(Exception e){out.println("error=" +e);}}}
Program Name: Homepage.jspProgram Function: This is the main form underwhich all the child form is open
45
Knowledge Base Management System
Homepage.jsp
<%@page import="java.sql.*"%>
46
Knowledge Base Management System<html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>HOMEPAGE</title><link rel="stylesheet" type="text/css" href="css.css" ></head><body> <% String val=(String)session.getAttribute("user");
Connection con=null; Statement stmt=null; ResultSet rs=null;
ResultSet rs1=null; int owncount=0,allcount=0;
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); rs=stmt.executeQuery("select * from Question where username='"+val+"'");
while(rs.next()) {
owncount++; } rs.close();
rs1=stmt.executeQuery("select queid from Question");
while(rs1.next()) {
allcount++; } rs1.close();
stmt.close(); con.close(); } catch(Exception e) { out.println("Error :"+e); } %> <% String a=(String)session.getAttribute("user"); if(a.equals("Admin")) { %>
<div id=WholePage align=center> <div id="Container" align=center>
47
Knowledge Base Management System <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Knowledge Base Management</font><br><font color=white>W W W.GENIUS ANSWER.COM</font> <div id="RightHeader"> </div></div> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp">Contact</a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a>
</div> </div> <div id="Left" align=center> <div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> (<%=owncount%>)</li> <li><a href="queansall.jsp">All Question </a> (<%=allcount%>)</li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <div id="Middle"> <div id="Page"> <div id="Content"> <div class="TopPart"> <h2>Knowledge Base Management</h2> <p class="Larger"><b>"Boosting Your Brain Power"</b></p> <p><I> Knowledge Base Management System</i> refers to a system for managing knowledge in organizations for supporting creation, capture, storage and dissemination of information. It can comprise a part of a Knowledge Management initiative.</p> <p> The idea of a KBMS system is to enable Users to have ready access to the organization's documented base of facts,sources of information, and solutions. Sharing this information organization wide can lead to more effective engine design and it could also lead to ideas for new or improved equipment.</p> <li><b>Purpose:</b> a KBMS will have an explicit Knowledge Management objective of some type such as collaboration, sharing good practice or the like</li>.
<li><b>Context:</b> One perspective on KBMS would see knowledge is information that is meaningfully organized, accumulated and embedded in a context of creation and application.</li> </div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span>
48
Knowledge Base Management System</div></div></div></div><% } else { %><div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader" align=left> <a href="homepage.jsp" id="home">Home</a>
</div></div> <div id="Inter" align=center>
<ul></ul> </div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="feedback.jsp">Feedback</a><a></a>
</div></div> <div id="Left" align=center>
<div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> (<%=owncount%>)</li> <li><a href="queansall.jsp">All Question </a> (<%=allcount%>)</li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <div id="Middle"> <div id="Page"> <div id="Content"> <div class="TopPart"> <h2>Knowledge Base Management</h2> <p class="Larger"><b>"Boosting Your Brain Power"</b></p> <p><I> Knowledge Base Management System</i> refers to a system for managing knowledge in organizations for supporting creation,capture, storage and dissemination of information. It can comprise a part of a Knowledge Management initiative.</p> <p> The idea of a KBMS system is to enable Users to have ready access to the organization's documented base of facts,sources of information, and solutions. Sharing this information organization wide can lead to more effective engine design and it could also lead to ideas for new or improved equipment.</p> <li><b>Purpose:</b> a KBMS will have an explicit Knowledge Management objective of some type such as collaboration, sharing good practice or the like</li>.
49
Knowledge Base Management System <li><b>Context:</b> One perspective on KBMS would see knowledge is
information that is meaningfully organized, accumulated and embedded in a context of creation and application.</li> </div></div></div></div> <div id="Footer" align=center >
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
<% } %></body></html>
Program Name: Question.jspProgram Function: This form is use for Insert users Question details
50
Knowledge Base Management System
Pseudo Code:
Sr. No. Name Procedure Description1 Submit Click Submit the question
Question.jsp
51
Knowledge Base Management System<%@page import ="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>question</title><link rel="stylesheet" type="text/css" href="css.css" >
<script language="JavaScript">function isSelected() { var select=frmQuestion.subject.value; if(select!=="") { frmQuestion.question.disabled=false;
frmQuestion.Submit.disabled=false; } if(select=="")
{ frmQuestion.question.disabled=true;frmQuestion.Submit.disabled=true;
} }function insert() { if( frmQuestion.question.value!=="")
{ alert("Your question submitted successfully !!!");return true;
}if( frmQuestion.question.value=="")
{ alert("Please , enter your question ");frmQuestion.question.focus();return false;
}return true;
}</script></head>
<body> <form name="frmQuestion" method="post" action="http://localhost:8090/kbm/servlet/Question"><div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font> <font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <% String a1=(String)session.getAttribute("user"); if(a1.equals("Admin")) {
52
Knowledge Base Management System %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a> <a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div> <div id="Left" align=center> <div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li> <li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <% } else { %> <div id="Inter" align=center> <ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="feedback.jsp">Feedback</a><a></a>
</div></div> <div id="Left" align=center> <div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> </li> <li><a href="queansall.jsp">All Question </a> </li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <% } %> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"> <center><img src ="img/question_logo.gif" width="200" height="80" /><table><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
53
Knowledge Base Management System<tr ><td><font size=4 ><center><b>SUBJECT:</b></font><select name="subject" onChange="isSelected()"> <option>-select category-</option> <%
Connection con=null;Statement stmt=null;ResultSet rs=null;
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement();
rs=stmt.executeQuery("select subjectid,subject from subject order by 1"); while(rs.next()) {
String p=rs.getString("subjectid"); String q=rs.getString("subject");
%> <option value='<%=p%>'><%=q%></option> <% } rs.close(); stmt.close(); con.close(); } catch(Exception e) { out.println("error"+e); }%></select><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td><font size=2><b>PLEASE ENTER YOUR QUESTION HERE:</b></font></td></tr><tr><td><textarea name="question" cols=40 rows=7 DISABLED ></textarea></td> </tr><tr><td></td></tr><tr><td></td></tr></table> <table align=center> <tr><td></td></tr><tr><td></td></tr><tr><td><input type="submit" name="Submit" value="Submit" DISABLED onClick="return insert()"></td></tr> </table> </div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span>
</div></div></div></div></form></body></html>
Question.java
import java.io.*;
54
Knowledge Base Management Systemimport java.sql.*;import javax.servlet.*;import javax.servlet.http.*;
public class Question extends HttpServlet{public void doPost(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{PrintWriter out=res.getWriter();res.setContentType("text/html");Connection con=null;Statement stmt=null;ResultSet rs=null;HttpSession hs=null;try{ hs=req.getSession(); String a=req.getParameter("subject"); String b=req.getParameter("question");String u=(String)hs.getAttribute("user"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123");stmt=con.createStatement();rs=stmt.executeQuery("select max(queid) from Question");rs.next();int que=rs.getInt(1);que++;rs.close();int result=stmt.executeUpdate("insert into Question values("+que+",'"+a+"','"+b+"','"+u+"',sysdate)");if(result!=0) { res.sendRedirect("http://localhost:8090/kbm/homepage.jsp");}elseout.println("please submit question!!!!!!");System.out.close();rs.close();con.close();stmt.close();}catch(Exception e){ System.out.println("Error="+e);} } }
Program Name: Queans.jspProgram Function: This form is use for Display own Question details
55
Knowledge Base Management System
Queans.jsp
<%@page import="java.sql.*"%><html>
56
Knowledge Base Management System<head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>queans</title><link rel="stylesheet" type="text/css" href="css.css" ></head>
<body > <form name="question" method="post"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <% String a=(String)session.getAttribute("user"); if(a.equals("Admin")) { %> <div id="Inter" align=center> <ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a><a href="help.jsp">Help center</a><a></a><a href="news.jsp">News</a><a></a><a href="adminfeedback.jsp">Feedback</a></a>
</div></div> <div id="Left" align=center>
<div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <% } else { %> <div id="Inter" align=center>
<ul></ul></div>
57
Knowledge Base Management System <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="feedback.jsp">Feedback</a><a></a>
</div></div> <div id="Left" align=center> <div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> </li> <li><a href="queansall.jsp">All Question </a> </li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <% } %> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart" overflow -x:scroll;width=30> <table align= center> <h3>My Question</h3> <% String val=(String)session.getAttribute("user");
Connection con=null; Statement stmt=null; ResultSet rs=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); rs=stmt.executeQuery("select queid,QUEST,attach,to_char(QUES_TIME,'dd/mm/yyyy hh12:mm:ss') DT from Question where username='"+val+"' order by 1"); while(rs.next()) { String id=rs.getString("queid"); %> <table align=center> <tr><td>*</td> <td ><%=rs.getString("quest")%></td> <td><a href='answer.jsp?id=<%=id%>'>(Ans)</a></td></tr></table> <table align=center><tr><td>(<%=rs.getString("DT")%>)</td></tr> <tr><td></td></tr><tr><td></td></tr></tr> <% } rs.close(); stmt.close(); con.close(); }
58
Knowledge Base Management System catch(Exception e) { out.println("Error : "+e); } %>
</table> </div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span>
</div></div></div></div> </form> </body></html>
Program Name: Queansall.jspProgram Function: This form is use for Display all Question details with subject wise
59
Knowledge Base Management System
Queansall.jsp
<%@page import="java.sql.*"%><html><head>
60
Knowledge Base Management System<meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>question</title><link rel="stylesheet" type="text/css" href="css.css" >
<script language="JavaScript">function send(num)
{ location.reload("http://localhost:8090/kbm/queansall.jsp?Num="+num);}
</script></head>
<body><form name="question" method="post"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a>
</div></div> <% String a=(String)session.getAttribute("user"); if(a.equals("Admin")) { %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a>
</div></div> <div id="Left" align=center>
<div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <% }
61
Knowledge Base Management System else { %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="feedback.jsp">Feedback</a><a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> </li> <li><a href="queansall.jsp">All Question </a> </li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <% } %> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"> <table align=center><h3>All Question</h3> <select name=subject onChange="send(this.value)"> <option>Select Catgory</option> <% int num=0;
String no=request.getParameter("Num"); if(no==null) num=0; else
num=Integer.parseInt(no); String val=(String)session.getAttribute("user");
Connection con=null; Statement stmt=null; ResultSet rs=null; ResultSet rs1=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); rs=stmt.executeQuery("select subjectid,subject from subject");
while(rs.next()) {
int id=rs.getInt("subjectid"); String sub=rs.getString("subject");
%>
62
Knowledge Base Management System <option value='<%=id%>'><%=sub%></option>
<% } rs.close(); %> </table> <table> <% rs1=stmt.executeQuery("select queid,QUEST,attach,username,to_char(QUES_TIME,'dd/mm/yyyy hh12:mm:ss') DT from Question where subjectid="+num+" order by 1 "); while(rs1.next()) { String id=rs1.getString("queid"); %> </table> <table align=center><tr><td>*</td> <td><%=rs1.getString("quest")%></td> <td ><a href='answer.jsp?id=<%=id%>'>(Ans)</a></td></tr></table> <table><tr><td>(<b><%=rs1.getString("username")%></b>:</td> <td><%=rs1.getString("DT")%>)</td><td></td></tr> <% } rs1.close(); stmt.close(); con.close(); }catch(Exception e){out.println("Error : "+e);}%></table></div> </div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span>
</div></div></div></div></form></body></html>
Program Name: Answer.jspProgram Function: This form is use for Insert users Answer
63
Knowledge Base Management System
Pseudo Code:
Sr. No. Name Procedure Description1 Submit Click Submit the answer
Answer.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html >
64
Knowledge Base Management System<meta name="description" content="" ><meta name="keywords" content="" ><title>Answer</title><link rel="stylesheet" type="text/css" href="css.css" >
<script language="JavaScript">function insert()
{ if( frmAnswer.answer.value!=""){ alert("Your answer submitted successfully !!!");
return true;}
if( frmAnswer.answer.value==""){ alert("Please , enter your answer ");
frmAnswer.answer.focus();return false;
}return true;
}</script></head><body>
<form name="frmAnswer" method="post" action="http://localhost:8090/kbm/servlet/Answer"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <% String a=(String)session.getAttribute("user"); if(a.equals("Admin")) { %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li>
65
Knowledge Base Management System <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <% } else { %> <div id="Inter" align=center> <ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="feedback.jsp">Feedback</a><a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> </li> <li><a href="queansall.jsp">All Question </a> </li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <% } %> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"> <table align=center > <% int i=Integer.parseInt(request.getParameter("id")); Connection con=null; Statement stmt=null; ResultSet rs=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); rs=stmt.executeQuery("select QUEST from Question where Queid="+i); while(rs.next()) { String b=rs.getString("quest");
session.putValue("QID",request.getParameter("id")); %> <tr><td> <%=request.getParameter("id")%> : <%=b%></td></tr>
66
Knowledge Base Management System <% }
rs.close();rs=stmt.executeQuery("select answer ,username,ans_date from Answer where
Queid="+i); while(rs.next())
{ %> </table> <table align=center><tr><td>*ANSWER:<%=rs.getString(1)%></td></tr></table> <table><tr><td>(<b><%=rs.getString(2)%></b></td> <td><%=rs.getString(3)%>)</td> <tr><td></td></tr><tr><td></td></tr></tr><tr><td></td></tr>
<% } rs.close(); stmt.close(); con.close(); }
catch(Exception e) { out.println("error"+e); }%></ table > <table align=center > <tr><td><font size=2><b>PLEASE SUBMIT YOUR ANSWER HERE:</b></font></td></tr><tr><td><textarea name="answer" cols=40 rows=7></textarea></td> </tr></table > < table align=center ><tr><td></td></tr><tr><td></td></tr><tr><td><input type="submit" value="Submit" onClick="return insert()"></td></tr></ table ></div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div> </div></div>
</form></body> </html>
Answer.java
import java.io.*;import java.sql.*;import javax.servlet.*;import javax.servlet.http.*;
public class Answer extends HttpServlet
67
Knowledge Base Management System{public void doPost(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{PrintWriter out=res.getWriter();res.setContentType("text/html");
Connection con=null;Statement stmt=null;ResultSet rs=null;HttpSession hs=null;
try{ hs=req.getSession(); int a=(int)Integer.parseInt(""+hs.getAttribute("QID")); String b=req.getParameter("answer"); String u=(String)hs.getAttribute("user"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); stmt.executeUpdate("insert into answer values("+a+",'"+b+"','"+u+"',sysdate)"); con.commit();
res.sendRedirect("http://localhost:8090/kbm/homepage.jsp");
rs.close(); con.close(); stmt.close();}
catch(Exception e){System.out.println("Error="+e);}}}
Program Name: Feedback.jspProgram Function: This form is use for Insert Users Feedback details
68
Knowledge Base Management System
Pseudo Code:
Sr. No. Name Procedure Description1 Submit Click Submit the feedback
Feedback.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" >
69
Knowledge Base Management System<meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>feedback</title><link rel="stylesheet" type="text/css" href="css.css" >
<script language="JavaScript">function isEmpty() { if( feedback.username.value=="" ) { alert("Please , insert username !!!"); feedback.username.focus();
return false; }
if( feedback.feed.value=="" ) { alert("Please , insert feedback !!!"); feedback.feed.focus(); return false;
} if( feedback.feed.value!=="" ) { alert("your feedback inserted succesfully !!!");
return true; }
return true; } function charOnly()
{ if((window.event.keyCode<65||window.event.keyCode>90)&&(window.event.keyCode<97 ||window.event.keyCode>122))
{ window.event.keyCode=false; alert("Please , Enter Character ");}
}
</script></head>
<body><form name="feedback" action="http://localhost:8090/kbm/servlet/Feedback" method="post"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <div id="Inter" align=center>
70
Knowledge Base Management System <ul> </ul></div>
<div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="feedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"> <h1>Feedback</h1> <table align=center><tr> <td><b>Username:</b><input type=text name=username onKeyPress="charOnly()"></td></tr></table><table><br><br><tr><td><b>Please give your feedback here</b></td></tr><tr><td><textarea name="feed" cols=40 rows=7></textarea></td></tr></table><table><tr><td><input type=submit value=submit onClick="return isEmpty()"></td></tr></table> </div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</form></body></html>
Program Name: Adminfeedback.jspProgram Function: This form is use for Display Users Feedback
71
Knowledge Base Management System
Adminfeedback.jsp
<%@page import ="java.sql.*"%><html><head>
72
Knowledge Base Management System<meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><title>Adminfeedback</title><link rel="stylesheet" type="text/css" href="css.css" ></head><body>
<form name="frmfeedback" method="post" action="http://localhost:8090/kbm/servlet/Feedback"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div> </div>
<div id="Left" align=center> <div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <div id="Middle"> <div id="Page">
<div id="Content"> <div class="TopPart"> <center> <h2>FEEDBACK:</h2> <table> <%
Connection con=null;Statement stmt=null;ResultSet rs=null;
73
Knowledge Base Management System try
{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123");
stmt=con.createStatement(); rs=stmt.executeQuery("select username,feed,to_char(Feedtime,'dd/mm/yyyy hh12:mm:ss') DT from feedback"); while(rs.next())
{ %> <tr><td><b>(Username:</b><%=rs.getString("username")%>)</td><td></td><td></td> <td>(<b>Feedback:</b><%=rs.getString("feed")%>)</td><td></td> <td>(<%=rs.getString("DT")%>)</td></tr><tr><td></td></tr><tr><td></td></tr> <% }
rs.close(); stmt.close(); con.close(); } catch(Exception e) { out.println("error"+e); } %></table></center> </div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</form></body></html>
Feedback.java
import java.io.*;import java.sql.*;import javax.servlet.http.*;import javax.servlet.*;
74
Knowledge Base Management System
public class Feedback extends HttpServlet{public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{PrintWriter out=res.getWriter();res.setContentType("text/html");
Connection con=null;Statement stmt=null;
try{
String a=req.getParameter("feed");String b=req.getParameter("username");Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123");
stmt=con.createStatement();int i1=stmt.executeUpdate("insert into feedback values('"+b+"','"+a+"',sysdate)"); if(i1!=0) {res.sendRedirect("http://localhost:8090/kbm/homepage.jsp");}elseout.println("something wrong");
stmt.close();con.close();}catch(Exception e){out.println("error=" +e);}}}
Logout.jsp
<%@page import="java.sql.*"%><HTML><% session.removeValue("user"); session.removeValue("password");
75
Knowledge Base Management System session.invalidate();%> <SCRIPT> parent.close() window.open("account.jsp") </SCRIPT></HTML>
Program Name: Subject.jspProgram Function: This form is use for Insert Subject details
76
Knowledge Base Management System
Pseudo Code:
Sr. No. Name Procedure Description1 Submit Click Submit the Subject
Subject.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html >
77
Knowledge Base Management System<meta name="description" content="" ><meta name="keywords" content="" ><title>Subject</title><link rel="stylesheet" type="text/css" href="css.css" ><script language="JavaScript"> function isEmpty() { if(frmsubject.subjectid.value=="")
{ alert("Please , Enter Subject id ");
frmsubject.SubjectId.focus();return false;}
if(frmsubject.subject.value==""){
alert("Please , Enter subject");frmsubject.Subject.focus();return false;}
if(frmsubject.subject.value!==""){
alert("Your subject submitted succesfully");return true;}
return true; } function numberOnly()
{ if(window.event.keyCode<48||window.event.keyCode>57)
{ window.event.keyCode=false; alert("Number Only"); } } function charOnly()
{ if((window.event.keyCode<65||window.event.keyCode>90)&& (window.event.keyCode<97||window.event.keyCode>122))
{ window.event.keyCode=false; alert("Character Only"); }
}</script></head> <body> <form name="frmsubject" action="http://localhost:8090/kbm/servlet/Subject" method="post"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
78
Knowledge Base Management System <div id="Header" align=left><font face="Constantia"
color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <div id="Inter" align=center>
<ul> </ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <div id="Middle"><div id="Page">
<div id="Content"><div class="TopPart"><h2>Add New Subject:</h2> <table align=center><tr><td>SubjectId</td><td><input type=text name=subjectid onKeyPress="numberOnly()"></td></tr><tr><td>Subject</td><td><input type=text name=subject onKeyPress="charOnly()"></td></tr></ table >< table ><tr><td><input type="submit" name="Submit" value="Submit" onClick="return isEmpty()"></td></tr> </ table ></div> </div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</form></body></html>
Subject.java
import java.io.*;import java.sql.*;import javax.servlet.http.*;import javax.servlet.*;
79
Knowledge Base Management System
public class Subject extends HttpServlet{public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{PrintWriter out=res.getWriter();res.setContentType("text/html");
Connection con=null;Statement stmt=null;
try{ String a=req.getParameter("subjectid");String b=req.getParameter("subject");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123");stmt=con.createStatement();
int i1=stmt.executeUpdate("insert into subject values('"+a+"','"+b+"')"); if(i1!=0) { res.sendRedirect("http://localhost:8090/kbm/homepage.jsp"); } elseout.println("something wrong");
stmt.close();con.close();}catch(Exception e){out.println("error=" +e);}}}
Program Name: Quedelete.jspProgram Function: This form is use for Delete Questions
80
Knowledge Base Management System
Quedelete.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" >
81
Knowledge Base Management System<meta name="keywords" content="" ><title>DeleteQuestion</title><link rel="stylesheet" type="text/css" href="css.css" >
<script language="JavaScript"> function send(num)
{ location.reload("http://localhost:8090/kbm/quedelete.jsp?Num="+num); } function check(num)
{ alert(num);
}</script></head><body ><form name="question" method="get"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div>
<div id="Middle"> <div id="Page">
<div id="Content"> <div class="TopPart"> <table align=center>
82
Knowledge Base Management System <h3>Delete Question</h3>
<select name=subject onChange="send(this.value)"> <option>Select Catgory</option><% int num=0; String no=request.getParameter("Num"); if(no==null) num=0;
else num=Integer.parseInt(no); String val=(String)session.getAttribute("user");
Connection con=null; Statement stmt=null; ResultSet rs=null; ResultSet rs1=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); rs=stmt.executeQuery("select subjectid,subject from subject");
while(rs.next()) { int id=rs.getInt("subjectid");
String sub=rs.getString("subject"); %> <option value='<%=id%>'><%=sub%></option> <% } rs.close(); %></ table > < table > <% rs1=stmt.executeQuery("select queid,QUEST,attach,username,to_char(QUES_TIME,'dd/mm/yyyy hh12:mm:ss') DT from Question where subjectid="+num+" order by 1"); while(rs1.next()) { String id=rs1.getString("queid"); %></table> <table border=0 align=center><tr><td><%=rs1.getString("quest")%></td><td><a href="http://localhost:8090/kbm/DeleteJSP.jsp?QID=<%=id%>">(Del)</a></td></tr></table> <table border=0align=center><tr> <td>(<b><%=rs1.getString("username")%> :</b></td><td><%=rs1.getString("DT")%>)</td></tr> <% } rs1.close(); stmt.close();
83
Knowledge Base Management System con.close(); }catch(Exception e){out.println("Error : "+e);}%></ table ></div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</form></body></html>
DeleteJSP.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" >
84
Knowledge Base Management System<title>DeleteQuestion</title><link rel="stylesheet" type="text/css" href="css.css" ></script></head>
<body><form> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center> <div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div> </div> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div><div id="Middle"> <div id="Page">
<div id="Content"> <div class="TopPart"> <%
Connection con=null; Statement stmt=null; Statement stmt1=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt1=con.createStatement(); stmt=con.createStatement(); int Q=Integer.parseInt(request.getParameter("QID"));
85
Knowledge Base Management System stmt1.executeUpdate("delete from answer where queid="+Q); stmt.executeUpdate("delete from question where queid="+Q); response.sendRedirect("http://localhost:8090/kbm/homepage.jsp"); stmt.close(); con.close(); } catch(Exception e) { out.println("Error : "+e); } %> </div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</form></body></html>
Program Name: About.jspProgram Function: This form is used for display about project Developer
86
Knowledge Base Management System
About.jsp
<%@page import ="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" >
87
Knowledge Base Management System<meta name="keywords" content="" ><title>News</title><link rel="stylesheet" type="text/css" href="css.css" ></head>
<body> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center>
<div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <% String a=(String)session.getAttribute("user"); if(a.equals("Admin")) { %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp">Contact</a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div>
<% } else { %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp">Contact</a><a></a>
88
Knowledge Base Management System <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="feedback.jsp">Feedback</a><a></a>
</div></div> <div id="Left" align=center>
<div id="LeftMenu" align=left> <div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> </li> <li><a href="queansall.jsp">All Question </a> </li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <% } %> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"><table><tr><td ><center><img src ="img/about.jpg" width="150" height="100" /></center><h3>About Us..........</h3></td></tr><tr><td><i><b>Knowledge Base Management System</b></i> refers to a system for managing knowledge in organizations for supporting creation, capture, storage of information.</td></tr><tr><td>the advantages claimed for KBM systems is:</td></tr><tr><td>Sharing of valuable organizational information throughout organisational hierarchy</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td align=center><b>Developed By:<i>Satish Kishor Patil</i></b></td></tr><tr><td align=center><b>Version:1.0.0.1</b></td></tr></table></div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div>
</div></body></html>
Program Name: news.jspProgram Function: This form is used for display current event
89
Knowledge Base Management System
News.jsp
<%@page import ="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" >
90
Knowledge Base Management System<meta name="keywords" content="" ><title>News</title><link rel="stylesheet" type="text/css" href="css.css" ></head>
<body> <div id=WholePage align=center> <div id="Container" align=center> <div id="Top" align=center><div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a> </div></div> <% String a=(String)session.getAttribute("user"); if(a.equals("Admin")) { %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp">Contact</a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a></li> <li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <% } else { %> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp">Contact</a><a></a><a href="help.jsp">Help center</a><a></a><a href="news.jsp">News</a><a></a>
91
Knowledge Base Management System<a href="feedback.jsp">Feedback</a><a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div> <li><a href="question.jsp">Knowledge Base Management</a></li>
<li><a href="queans.jsp">My Question </a> </li> <li><a href="queansall.jsp">All Question </a> </li> <li><a href="LogOut.jsp">Signout</a></li> </div></div> <% } %> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"><table><tr><td ><center><img src ="img/tech_support_icon.png" width="200" height="100" /></center><h3>Educational News.....</h3></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td><b>ARCHITECTURAL CLASS</b> Architectural_ CET/Nata & Interiors Entrance Exam Coaching starts April 2011 by Architect/Professor Raju b. govalkar : 9821173563 / 9969699169 Reasonable fees. Register now.</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td><b>SAMADHAN INST.</b> XII,& B.COM,B.SC. & M.B.A,P.H.D. (All Stream) B.ED, LLB with Registration Regular. University Samadhan Institue. Anheri (W):9920713533</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td><b>DRONACHARYA</b> Academy 100%Result Oriented Tutor available for all Subject/Board/Standard contact-9324088263,9076950808</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td><b>PCMB-TUTORIAL</b>for XII std. Learn from exp Ruparel College Professors, pvt Tuitionfor XI-XII,MH-CET, Ganesh sir:9224595398/80977474180</td></tr></table></div> </div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</body></html>
Report Layouts
Program Name: Allreport.jspProgram Function: This form is used for display Reports
92
Knowledge Base Management System
Pseudo Code:
Sr. No. Name Procedure Description1 Student’s Report Click Display Report of Student 2 Question’s Report Click Display Report of Question
Allreport.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" >
93
Knowledge Base Management System<title>Allreport</title><link rel="stylesheet" type="text/css" href="css.css" ><SCRIPT language="JavaScript">function send1(){ var id=FrmReport.value;
location.reload("http://localhost:8090/kbm/studentreport.jsp?ID="+id); }function send2(){ var id=FrmReport.snamevalue; location.reload("http://localhost:8090/kbm/quereportdis.jsp?ID="+id); }</script></head><body>
<form name="FrmReport" method="post"> <div id=WholePage align=center> <div id="Container" align=center> div id="Top" align=center> <div id="Header" align=left><font face="Constantia" color=yellow>Welcome,</font><font size=5 color=orange><%=(String)session.getAttribute("user")%>!!!</font> <div id="RightHeader"> <a href="homepage.jsp" id="home">Home</a>
</div></div> <div id="Inter" align=center>
<ul></ul></div> <div id="Menu" align=center> <a href="about.jsp">About us</a><a></a>
<a href="contact.jsp"> Contact </a><a></a> <a href="help.jsp">Help center</a><a></a> <a href="news.jsp">News</a><a></a> <a href="adminfeedback.jsp">Feedback</a></a> </div></div>
<div id="Left" align=center> <div id="LeftMenu" align=left>
<div class="LeftHeader" align=left>Category</div>
<li><a href="question.jsp">Knowledge Base Management</a></li> <li><a href="queans.jsp">My Question </a></li>
<li><a href="queansall.jsp">All Question </a></li> <li><a href="LogOut.jsp">Signout</a></li> <li><a href="subject.jsp">Insert Suject</a></li> <li><a href="quedelete.jsp">Delete Question</a></li> <li><a href="allreport.jsp">Report</a></li> </div></div> <div id="Middle">
<div id="Page"> <div id="Content">
94
Knowledge Base Management System <div class="TopPart"><table align=center><% Connection con=null; Statement stmt=null; ResultSet rs=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement();%><br><br><br><br><br><br><tr><td><input type=button value=" Student's Report " name=student onClick="send1()"></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr><tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr><tr><td><input type=button value=" Question'sReport " name=question onClick="send2()"></td></tr><%stmt.close();con.close();out.close();}catch(Exception e){out.println("Error="+e);}%></table></div></div></div></div> <div id="Footer" align=center>
<div id="Bottom" align=center><span><a href="#">E-shop design by Satish Patil</a></span></div></div></div></div>
</form></body></html>
Program Name: Studentreport.jspProgram Function: This report is use to show the users Details
95
Knowledge Base Management System
Studentreport.jsp
<%@page import="java.sql.*"%><html><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" ><head><title>StudentReport</title>
96
Knowledge Base Management System<link rel="stylesheet" type="text/css" href="css2.css" ></head><body>
<form name="FrmReport" method="post"><div id=WholePage align=center> <div id="Container" align=center> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"> <% Connection con=null; Statement stmt=null; ResultSet rs=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); %> <font size=5 color=white>Knowledge Base Management</font><br><br> <font size=6 color=white><u>User's Report</u></font> <table align=center border=1> <tr><td><font size=3 color=yellow>StudentId</td> <td><font size=3 color=yellow>FirstName</td> <td><font size=3 color=yellow>LastName</td> <td><font size=3 color=yellow>Birth Date</td>
<td><font size=3 color=yellow>Address</td> <td><font size=3 color=yellow>Gender</td> <td><font size=3 color=yellow>Username</td> <td><font size=3 color=yellow>Password</td> <td><font size=3 color=yellow>Phone no</td> <td><font size=3 color=yellow>Qualification</td> <td><font size=3 color=yellow>Collage</td></tr>
<% rs=stmt.executeQuery("select * from newaccount where status='S' order by 1");
while(rs.next()) {
%> <tr><td><%=rs.getInt("regid")%></td>
<td><%=rs.getString("firstname")%></td><td><%=rs.getString("lastname")%></td><td><%=rs.getString("dob")%></td><td><%=rs.getString("address")%></td><td><%=rs.getString("gender")%></td><td><%=rs.getString("username")%></td><td><%=rs.getString("passward")%></td><td><%=rs.getString("phoneno")%></td><td><%=rs.getString("qualification")%></td><td><%=rs.getString("college")%></td></tr>
<%
97
Knowledge Base Management System }rs.close();stmt.close();con.close();out.close();}catch(Exception e){out.println("Error="+e);}%></table> </div> </div> </div></div> </form></body></html>
Program Name: Quereportdis.jsp Program Function: This report is use to show the users Question
98
Knowledge Base Management System
Quereportdis.jsp
<%@page import="java.sql.*"%><html><head><meta http-equiv="Content-language" content="cs" ><meta http-equiv="Content-Type" content="text/html ><meta name="description" content="" ><meta name="keywords" content="" >
99
Knowledge Base Management System<title>QuestionReport</title><link rel="stylesheet" type="text/css" href="css2.css" ><script language="JavaScript">function send2(num) {
location.reload("http://localhost:8090/kbm/quereportdis.jsp?Num="+num); }</script></head>
<body><form name="FrmReport" method="post"> <div id=WholePage align=center> <div id="Container" align=center> <div id="Middle">
<div id="Page"> <div id="Content">
<div class="TopPart"> <font size=5 color=white>Knowledge Base Management</font><br><br> <font size=6 color=white><u>Question's Report</u></font> <table align=center><br><br><br> <select name=user onChange="send2(this.value)"> <option>-Select User-</option> <% String no=request.getParameter("Num");
Connection con=null; Statement stmt=null; ResultSet rs=null; ResultSet rs1=null;
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:skp","satish","satish123"); stmt=con.createStatement(); rs=stmt.executeQuery("select DISTINCT username from Question order by 1"); while(rs.next())
{ String a=rs.getString("username"); %> <option value='<%=a%>'><%=a%></option>
<% }
rs.close();%>
</table><table align=center> <% rs1=stmt.executeQuery("select queid,quest from question where username='"+no+"'");
while(rs1.next()) {
100
Knowledge Base Management System String id=rs1.getString("queid");
String que=rs1.getString("quest"); %> <tr><td align=right><font size=3 color=yellow><!--<%=id%>-->@</font> </td><td><font size=5 color=yellow><%=que%></font></td></tr> <% } rs1.close(); stmt.close(); con.close(); } catch(Exception e) { out.println("Error="+e); } %></table> </div> </div> </div></div> </form></body></html>
Web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"><web-app>
<servlet>
101
Knowledge Base Management System <servlet-name>newaccount</servlet-name> <servlet-class>newaccount</servlet-class></servlet>
<servlet-mapping> <servlet-name>newaccount</servlet-name> <url-pattern>/servlet/newaccount</url-pattern></servlet-mapping>
<servlet> <servlet-name>Login</servlet-name> <servlet-class>Login</servlet-class></servlet>
<servlet-mapping> <servlet-name>Login</servlet-name> <url-pattern>/servlet/Login</url-pattern></servlet-mapping>
<servlet> <servlet-name>Question</servlet-name> <servlet-class>Question</servlet-class></servlet>
<servlet-mapping> <servlet-name>Question</servlet-name> <url-pattern>/servlet/Question</url-pattern></servlet-mapping>
<servlet> <servlet-name>Answer</servlet-name> <servlet-class>Answer</servlet-class></servlet>
<servlet-mapping> <servlet-name>Answer</servlet-name> <url-pattern>/servlet/Answer</url-pattern></servlet-mapping>
<servlet> <servlet-name>Subject</servlet-name> <servlet-class>Subject</servlet-class></servlet>
<servlet-mapping> <servlet-name>Subject</servlet-name> <url-pattern>/servlet/Subject</url-pattern></servlet-mapping>
<servlet> <servlet-name>Feedback</servlet-name>
102
Knowledge Base Management System <servlet-class>Feedback</servlet-class></servlet>
<servlet-mapping> <servlet-name>Feedback</servlet-name> <url-pattern>/servlet/Feedback</url-pattern></servlet-mapping>
</web-app>
Validations
Date Should be entered in the mm/dd/yy formate & must be separated by slash (/)
103
Knowledge Base Management System
Password and Repassword must be match
104
Knowledge Base Management System
Valid.js
function isDate(dtStr){var dtCh= "/";var minYear=1900;var maxYear=2100;var daysInMonth =new Array(12);var pos1=dtStr.indexOf(dtCh);var pos2=dtStr.indexOf(dtCh,pos1+1);var strMonth=dtStr.substring(0,pos1);var strDay=dtStr.substring(pos1+1,pos2);var strYear=dtStr.substring(pos2+1);strYr=strYear;
105
Knowledge Base Management Systemif (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)for (var i = 1; i <= 3; i++)
{ if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)}month=parseInt(strMonth);day=parseInt(strDay);year=parseInt(strYr);if (pos1==-1 || pos2==-1)
{ alert("The date format should be : mm/dd/yyyy")return false
}if (strMonth.length<1 || month<1 || month>12)
{ alert("Please enter a valid month");return false;
}if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day
> daysInMonth[month]) { alert("Please enter a valid day");
return false;}if (strYear.length != 4 || year==0 || year<minYear || year>maxYear)
{ alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear);return false;
}if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false)
{ alert("Please enter a valid date");return false;
}return true;}function ValidateForm(){ var dt=document.newaccount.dob
if (isDate(dt.value)==false) { dt.focus()
return false } return true; }function isEmpty()
{if(newaccount.firstname.value==""){ alert("Please , Enter Your First Name ");
newaccount.firstname.focus();return false;
} if(newaccount.lastname.value=="")
{ alert("Please , Enter Your Last Name ");newaccount.lastname.focus();return false;
} if(newaccount.dob.value=="")
106
Knowledge Base Management System{ alert("Please , Enter Birthdate ");
newaccount.dob.focus();return false;
} if(newaccount.address.value=="")
{ alert("Please , Enter Your Address ");newaccount.address.focus();return false;
} if(newaccount.gender.value=="")
{ alert("Please , Select Gender ");newaccount.gender.focus();return false;
} if(newaccount.username.value=="")
{ alert("Please , Enter Your Last Name ");newaccount.username.focus();return false;
} if(newaccount.passward.value=="")
{ alert("Please , Enter Your Password ");newaccount.passward.focus();return false;
} if(newaccount.repassward.value=="")
{ alert("Please , Retype The Password ");newaccount.repassward.focus();return false;
} if(newaccount.phoneno.value=="")
{ alert("Please , Enter Mobile No. ");newaccount.phoneno.focus();return false;
} if(mb.length<10||mb.length>10)
{ alert("Please , Enter Valid Mobile No.");newaccount.phoneno.focus();return false;
} if(newaccount.qualification.value=="")
{ alert("Please , Select Qualification ");newaccount.qualification.focus();return false;
} if(newaccount.college.value=="")
{ alert("Please , Enter College Name ");newaccount.college.focus();return false;
}return true;
}
107
Knowledge Base Management System
function confirmPass(){
var type=newaccount.passward.value;var retype=newaccount.repassward.value;if(type!=retype) { alert("Password doesn't match !\n Again Enter Password !!!");
newaccount.passward.value="";newaccount.repassward.value="";newaccount.pass1.focus();return false;
}return true;
}
function numberOnly(){ if(window.event.keyCode<48||window.event.keyCode>57)
window.event.keyCode=false;}
function charOnly(){ if((window.event.keyCode<65||
window.event.keyCode>90)&&(window.event.keyCode<97||window.event.keyCode>122)) window.event.keyCode=false;
}
Chapter 5
108
Knowledge Base Management System
System Implementation
System Implementation
Following are the steps to be followed for implementing the system:
109
Knowledge Base Management System
1. Install required software on server machine. i.e. Tomcat 4.1 and oracle 10g 2. First you have to upload files on the server machine.3. Connect the server machine in a network.
110
Knowledge Base Management System
Chapter 6
FutureEnhancement
111
Knowledge Base Management System
Future EnhancementIn my future version of this system I would like to add some following features in my
project:
1. Some more reports will be added to make administrator task easier.
2. Interface will be made more user friendly.
112
Knowledge Base Management System
Chapter 7
Conclusion
CONCLUSION113
Knowledge Base Management System
Hereby I conclude that from my project a student will get benefited and can get information at one place only. A student can get relevant information with some advice from other user. Admin can control and edit the questions asked. Records will be retrieved very efficiently. User can ask and answer questions from remote location.
114
Knowledge Base Management System
Chapter 8
Bibliography
Bibliography115
Knowledge Base Management System
1. Java Programming: Advanced Topics by Joe Wigglesworth and Paula McMillan,
Thomson Course, Third Edition 2004
2. Java 2: The Complete Reference by Herbert Schildt, Tata McGraw Hill, Fifth
Edition
3. Web Enabled Commercial Applications Development Using Java 2 by Ivan
Bayross, BPB Publication, Revised Edition 2006
4. http://www.oracle.co.in/
5. http://www.google.co.in/
6. Programming With Java : E.Balagurusamy , Third Edition
116