JSP search engine

JSP search engine

View Answers

April 7, 2012 at 7:43 AM

1)search.jsp:

<html>
<head>
</head>
<body>
<br><br><br><br><br><br>
<form method="post" name="frm" action="..//search">
<table border="0" width="300" align="center" bgcolor="#CDFFFF">
<tr><td colspan=2 style="font-size:12pt;color:#00000;" align="center">
<h3>Search Item</h3></td></tr>
<tr><td ><b>Item Starts With</b></td>
<td>: <input type="text" name="name" id="name">
</td></tr>
<tr><td colspan=2 align="center">
<input type="submit" name="submit" value="Search"></td></tr>
</table>
</form>
</body>
</html>

2) Search.java:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.sql.*;
import java.sql.*;
import java.util.*;

public class Search extends HttpServlet{

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException,IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();

System.out.println("MySQL Connect Example.");
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";;
String dbName = "register";
String driver = "com.mysql.jdbc.Driver";
String userName = "root";
String password = "root";


Statement st;
try {
Class.forName(driver).newInstance();
conn = DriverManager.getConnection(url+dbName,userName,password);
System.out.println("Connected to the database");
String name = request.getParameter("name");
String query = "select * from item where name LIKE '"+name+"%'";
st = conn.createStatement();
ResultSet rs = st.executeQuery(query);
out.println("<table border='1'><tr><th>Row Num</th><th>Item Code</th><th>Item Name</th><th>Item Price</th></tr>");
while(rs.next()){

out.println("<tr><td>"+rs.getString(1)+"</td><td>"+rs.getString(2)+"</td><td>"+rs.getString(3)+"</td><td>"+rs.getString(4)+"</td></tr>");
}
out.println("</table>");
conn.close();
System.out.println("Disconnected from database");
} catch (Exception e) {
e.printStackTrace();
}
}
}

3)web.xml:

<servlet-name>searchServlet</servlet-name>
<servlet-class>Search</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>searchServlet</servlet-name>
<url-pattern>/search</url-pattern>
</servlet-mapping>









Related Tutorials/Questions & Answers:
JSP search engine - JSP-Servlet
JSP search engine  Hi! In my project i have a concept of search engine which has to search in google and display the results in my page. My PM told me use GOOGLE API for search engine. I am developing applicatin in JSP. Can
Search Engine
Search Engine  I have gone through the below mentioned link document to create search engine and fetch the data from mysql database.But i am getting errors. http://www.roseindia.net/sql/mysql-table/sql-search.shtml Error: Notice
Advertisements
Search Engine - Java Beginners
Search Engine  Hello Sir, I am new jsp, also i need search engine coding from the local computer or database only.pls send the jsp with mysql codes.I dont know how to create a search engine(like google) in local computer
about search engine
about search engine   Hi i am novice in jsp. i am developing web site in that i want to search product by its name and display it by its image with description,so want some help. Thank you
Lucene Search in JSP - JSP-Servlet
Lucene Search in JSP  Hello Sir, I want to Develop lucene - Search engine in Jsp page which can Search full text from XML file..through XML parser.. Example: in Search interface there are one textbox after putting some value
simple java search engine
. ABSTRACT Title : Simple Search Engine System Specification: The system on which.... This is needed for every one. The project is simple search engine, which searches...simple java search engine  i have already downloaded the project
Search engine for email
Search engine for email  Build a search engine which will look at your email inbox and sort your email into 5 or more bins according to some criteria (e.g. date, email address, text of the email
Search operation in JSP page
Search operation in JSP page  How to perform search in jsp with MYSQL database plz help me
ModuleNotFoundError: No module named 'search-engine'
ModuleNotFoundError: No module named 'search-engine'  Hi, My... 'search-engine' How to remove the ModuleNotFoundError: No module named 'search-engine' error? Thanks   Hi, In your python
Search Page in jsp
Search Page in jsp  search page in jsp   Please go through the following links: http://www.roseindia.net/jsp/user-search.shtml http://www.roseindia.net/servlets/search.shtml
Search page form in jsp
Search page form in jsp  search form in jsp   Please go through the following links: http://www.roseindia.net/jsp/user-search.shtml http://www.roseindia.net/servlets/search.shtml
search form in jsp
search form in jsp  search page in jsp   Please go through the following links: http://www.roseindia.net/jsp/user-search.shtml http://www.roseindia.net/servlets/search.shtml
Finding searching phrase of a search engine
Finding searching phrase of a search engine  how to find out searching phrase of a search engine..? like, if visitors enter the keyword to google, is is any possible to get that keyword
SEO and Search Engines,Best Search Engines on Web,What is Search Engine
SEO and Search Engine   ... of the search engine while doing SEO work. Since in SEO we are using search engine to promote our website, so understanding the search engine details like
Search Engine Interface
Search Engine Interface       In this section we will describe about the search and index interface of our search engine. For searching and displaying the result we
Developing Search Engine in Java
Developing Search Engine in Java       In this section we will discuss about the search engine, and then show you how you can develop your own search engine for your website
ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine'
ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine' ...: ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine' How to remove the ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine' error
ModuleNotFoundError: No module named 'odoo12-addon-connector-search-engine'
ModuleNotFoundError: No module named 'odoo12-addon-connector-search-engine...: ModuleNotFoundError: No module named 'odoo12-addon-connector-search-engine' How...-search-engine After the installation of odoo12-addon-connector-search-engine
ModuleNotFoundError: No module named 'search-engine-parser'
ModuleNotFoundError: No module named 'search-engine-parser'  Hi...: No module named 'search-engine-parser' How to remove the ModuleNotFoundError: No module named 'search-engine-parser' error? Thanks   Hi
ModuleNotFoundError: No module named 'odoo10-addon-connector-search-engine'
ModuleNotFoundError: No module named 'odoo10-addon-connector-search-engine...: ModuleNotFoundError: No module named 'odoo10-addon-connector-search-engine' How...-search-engine After the installation of odoo10-addon-connector-search-engine
ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine'
ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine' ...: ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine' How to remove the ModuleNotFoundError: No module named 'odoo10-addons-oca-search-engine' error
ModuleNotFoundError: No module named 'odoo12-addons-oca-search-engine'
ModuleNotFoundError: No module named 'odoo12-addons-oca-search-engine' ...: ModuleNotFoundError: No module named 'odoo12-addons-oca-search-engine' How to remove the ModuleNotFoundError: No module named 'odoo12-addons-oca-search-engine' error
ModuleNotFoundError: No module named 'odoo13-addon-connector-search-engine'
ModuleNotFoundError: No module named 'odoo13-addon-connector-search-engine...: ModuleNotFoundError: No module named 'odoo13-addon-connector-search-engine' How...-search-engine After the installation of odoo13-addon-connector-search-engine
ModuleNotFoundError: No module named 'search_engine_app'
ModuleNotFoundError: No module named 'search_engine_app'  Hi, My... named 'search_engine_app' How to remove the ModuleNotFoundError: No module named 'search_engine_app' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'search-engine-scraper'
ModuleNotFoundError: No module named 'search-engine-scraper'  Hi...: No module named 'search-engine-scraper' How to remove the ModuleNotFoundError: No module named 'search-engine-scraper' error? Thanks   Hi
ModuleNotFoundError: No module named 'search-engine-spider'
ModuleNotFoundError: No module named 'search-engine-spider'  Hi...: No module named 'search-engine-spider' How to remove the ModuleNotFoundError: No module named 'search-engine-spider' error? Thanks   Hi
Submitting Web site to search engine
to the search engines, the search engine crawls will visit your site and will index your pages to the search engine index. Once your web site appears... do to improve their search engine placement. How to submit the web
search feature - JSP-Servlet
search feature  i need help to do a search feature servlet to search for employees from the database. the search will be done by search by employee name, department and email  Hi friend, As per your problem
search engine build by lucene and eclipse
search engine build by lucene and eclipse  Hi, here is the code...); frame.setTitle("SEARCH ENGINE"); frame.setSize(500, 400); frame...()); btnsrc = new JButton("Search"); label = new JLabel("Query
search functionality using jsp from database
search functionality using jsp from database  search functionality using jsp from database
save links clicked in search engine results
save links clicked in search engine results  hello i need to access search engine results in my program(any search engine).ie suppose i give a keyword,i need the results returned by that search engine.from the returned results
Download Search Engine Code its free and Search engine is developed in Servlets
web server. To test your search engine key http://localhost:serverport/servlet/search in your browser. By now your search engine should work.   Download Search
regarding designing of web search engine - Development process
regarding designing of web search engine  we want to design a web search engine in java. so, how to get started with our coding...can i get sample code for web crawlers or similar requirements... help us
Java Search Engine - Java Beginners
Java Search Engine  Hello Sir,The Code Provided by u is very Useful for me,Thank u for Help, but I have one Question is How to Install and Run Mysql ,can I use Sql Server insted of MySql. and How to Install Servlet and Run
JSP Servlet Search and Edit - JSP-Servlet
JSP Servlet Search and Edit  Hi, I want to thank the people who... to the following jsp. Also, when I use it for a character column, if the backend table... there is a search which populates the search result table, On single click
Writing to be located through the Search Engine
Writing to be located through the Search Engine       The majority of web users depend upon search... a search he should immediately know how the page that has opened up connects to his
Writing to be located through the Search Engine
Writing to be located through the Search Engine  ... search engines of all kind to locate and navigate web pages. While writing text... a search he should immediately know how the page that has opened up connects
Building Search Engine Applications Using Servlets !
Building Search Engine Applications Using Servlets Introduction This tutorial takes you through the process of building search engine... these days. This search engine shows you how to use Java Servlets
How to code a Product id search engine?
How to code a Product id search engine?  I always wonder how people... a search box that let users search products with id. Suppose, "If an user enters id:1234 (and hits search button) go to product page url: http://#" if user
SEO Guide,Search Engine Optimization,Basic of SEO,Search Engine Optimization Information
Search Engine Optimization What is Search Engine Optimization? Search... ranking within search engines. Search Engine Optimization are done to attend the highest ranking in the search engine results for some targeted keywords
Top 10 SEO Mistakes,Common Mistakes in Search Engine Optimization,Search Engine Marketing Mistakes
Search Engine Mistakes - Search Engine Optimization Mistakes... content but they do not rank well on the search engine results. These low placements.... People uses the different Search Engine Optimization techniques to boost web
search an element in arraylist and display in jsp page
search an element in arraylist and display in jsp page  Hello Can anyone help how to take input from user from a jsp page to search for a substing in arraylist in java class and display the list in jsp page Thanks
Source Code for Search Engine Project in java - Java Beginners
Source Code for Search Engine Project in java  Hello Sir ,I want Java Project for Search Engine(like google),How I can Make it,Plz Give Me Complete Source Code Of Search Engine Project in Java.  Hi Friend, Please
org.hibernate - hibernate-search-engine version 5.3.0.Beta2 Maven dependency. How to use hibernate-search-engine version 5.3.0.Beta2 in pom.xml?
org.hibernate  - Version 5.3.0.Beta2 of hibernate-search-engine Maven... of hibernate-search-engine in pom.xml? How to use hibernate-search-engine version... it easy to use org.hibernate  - Version 5.3.0.Beta2 of hibernate-search-engine
org.hibernate - hibernate-search-engine version 4.4.6.Final Maven dependency. How to use hibernate-search-engine version 4.4.6.Final in pom.xml?
org.hibernate  - Version 4.4.6.Final of hibernate-search-engine Maven... of hibernate-search-engine in pom.xml? How to use hibernate-search-engine version... it easy to use org.hibernate  - Version 4.4.6.Final of hibernate-search-engine
org.hibernate - hibernate-search-engine version 4.5.0.Alpha2 Maven dependency. How to use hibernate-search-engine version 4.5.0.Alpha2 in pom.xml?
org.hibernate  - Version 4.5.0.Alpha2 of hibernate-search-engine Maven... of hibernate-search-engine in pom.xml? How to use hibernate-search-engine version...; org.hibernate - hibernate-search-engine project have released the latest version
org.hibernate - hibernate-search-engine version 5.10.4.Final Maven dependency. How to use hibernate-search-engine version 5.10.4.Final in pom.xml?
org.hibernate  - Version 5.10.4.Final of hibernate-search-engine Maven... of hibernate-search-engine in pom.xml? How to use hibernate-search-engine version...; org.hibernate - hibernate-search-engine project have released the latest version
org.hibernate.search - hibernate-search-engine version 6.0.0.Alpha3 Maven dependency. How to use hibernate-search-engine version 6.0.0.Alpha3 in pom.xml?
org.hibernate.search  - Version 6.0.0.Alpha3 of hibernate-search-engine... 6.0.0.Alpha3 of hibernate-search-engine in pom.xml? How to use hibernate-search-engine... of hibernate-search-engine in project by the help of adding the dependency
org.hibernate - hibernate-search-engine version 5.7.0.CR1 Maven dependency. How to use hibernate-search-engine version 5.7.0.CR1 in pom.xml?
org.hibernate  - Version 5.7.0.CR1 of hibernate-search-engine Maven...-search-engine in pom.xml? How to use hibernate-search-engine version 5.7.0.CR1... to use org.hibernate  - Version 5.7.0.CR1 of hibernate-search-engine
org.hibernate - hibernate-search-engine version 5.4.0.CR2 Maven dependency. How to use hibernate-search-engine version 5.4.0.CR2 in pom.xml?
org.hibernate  - Version 5.4.0.CR2 of hibernate-search-engine Maven...-search-engine in pom.xml? How to use hibernate-search-engine version 5.4.0.CR2... to use org.hibernate  - Version 5.4.0.CR2 of hibernate-search-engine

Ads