Source Code for Implementing Search Feature in JSF/JSP using Servlet

Source Code for Implementing Search Feature in JSF/JSP using Servlet

View Answers

June 19, 2008 at 1:15 PM

Hi friend,


package javacode;

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

public class RetriveValue extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException{
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
Connection con = null;
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String password="amar123";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,password);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("Select userid, name, dept_name, date from userSearch WHERE userid='102'");
while(rs.next()){
pw.println("userid" + " " + "name" + " "+"dept_name"+" " + "date" +"<br>");
pw.println(rs.getInt(1) + " " + rs.getString(2) +" "+ rs.getString(3) +" "+rs.getString(4) +"<br>");

}
}
catch (Exception e){
pw.println(e);
}
}
}

-------------------------------------------------------

Read for more information,

http://www.roseindia.net/servlets/

Thanks.









Related Tutorials/Questions & Answers:
Source Code for Implementing Search Feature in JSF/JSP using Servlet - Java Beginners
Source Code for Implementing Search Feature in JSF/JSP using Servlet  How do I write the source code to implement search feature in JSF/JSP using Servlet?? Please advice using the example data below:- Thank You!! Employee
Source Code for Implementing Search Feature in JSP using Java action/Servlet - JSP-Servlet
Source Code for Implementing Search Feature in JSP using Java action/Servlet  How do I write the source code to implement search feature in JSP using...) as X, (select @rownum:=0) AS r What I want is: Search feature that I want
Advertisements
Source Code for Implementing Search Feature in JSP using Java Action/Servlet - JSP-Interview Questions
Source Code for Implementing Search Feature in JSP using Java Action/Servlet  How do I write the source code to implement search feature in JSP using... searchServlet /search Thanks  I have following your source code
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
Servlets in JSF - JSP-Servlet
.... Simply what is the role of servlets in JSF. which one is the best one..jsp...Servlets in JSF  Hi! I am using Java Visual Studio to develop my.... by double click on the control i am writing the code. As i can write the code
source code - JSP-Servlet
source code  please i want source code for online examination project (web technologies)  Hi Friend, Send some details of your project. Thanks
source code - JSP-Servlet
source code for webcam chat application  I want source code for this webcam chat application. I like the concept of XAWARE ORG regarding web cam chat. So that i want the code through this XAWARE only.pls send the code as soon
source code - JSP-Servlet
source code  i need source code for client server application in jsp to access multiple clients   Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/ Here you will get lot of examples
source code - JSP-Servlet
source code  i want source code for my project online examination it includes two modules user and administrator so if user want to write exam first he register his details and then select the topics on which he want to write
source code - JSP-Servlet
source code  i want source code for my project online examination it includes two modules user and administrator so if user want to write exam first he register his details and then select the topics on which he want to write
source code - JSP-Servlet
source code  I want source code for Online shopping Cart... Rakesh, I am sending a link where u will found complete source code..., and Cost. Customers can only view the bill details. Deliverables HTML/ JSP
B+ tree JAVA source code for implementing Insertion and Deletion - Java Beginners
B+ tree JAVA source code for implementing Insertion and Deletion  Can anyone plz mail de B+ tree JAVA source code for implementing Insertion...("Search value is: " + root.Search(24)); System.out.println("Search value
Sorting data in a jsp using a servlet while implementing comparable - JSP-Servlet
Sorting data in a jsp using a servlet while implementing comparable  ... which is stored in the session scope of a servlet. Below is its code... at line 14 of the jsp code. I also want it to implement comparable to use
download code using servlet - Servlet Interview Questions
download code using servlet  How to download a file from web to our system using Servlet
View source code of a html page using java ..
View source code of a html page using java ..  I could find the html source code of a web page using the following program, http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLConnection.html i could get the html code
Implementing FTP in Java Code
Implementing FTP in Java Code  Hi, My job is to write a program in Java in my project. I have to implement FTP in my Java Code. Share me some of the code of Implementing FTP in Java Code. Thanks   Hi, Apache ftp
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
code for implementing sale purchase
code for implementing sale purchase  i have two tables in database. in one table i have stock of sms and further details and other table is for customer .if customer purchases my sms then the value will be deduct from my table
either jsf or jsp?
either jsf or jsp?  which is better technology to display dynamic data by using either jsf or jsp
JSF - JSP-Servlet
JSF Jars in web inf lib   I don't know where to place Jar files in JSF. Please advise.Thanks in Advance
java source code to create mail server using struts2
java source code to create mail server using struts2  java source code to create mail server using struts2
java source code to send group mails using struts2
java source code to send group mails using struts2  code to send group mails using struts2
give me source code of webpage creation using html
give me source code of webpage creation using html  how to create a webpage using html
code for password strength using jsp-servlet
code for password strength using jsp-servlet  hi.............. plz help me to give code for password strength using jsp-servlet for implementation in my project as soon as possible because i want to show this functionality in my
mini project using html,javascript and ms access with source code
mini project using html,javascript and ms access with source code  I want a mini project which uses html and java script and backend as ms access with source code. plz send its important and urgent
You asked full source code for search - Development process
You asked full source code for search  Hi, For this code can u give me code for display records when i select any field Search Page var arr = new Array(); arr["Select"] = new Array("-select
Source code
Source code  source code of html to create a user login page
source code in java for a program using class - Java Beginners
source code in java for a program using class  Dear sir/madam i want source code in java for following program: WAP which creates a class accountthat stores customer name,account number and type of account.From this derive
HTML code to servlet to database using jdbc
HTML code to servlet to database using jdbc  pls send me the code related to the title   Hi Friend, Try the following code:ADS_TO_REPLACE_1 1)form.html: <html> <form method="post" action="http://localhost
source code
source code  sir...i need an online shopping web application on struts and jdbc....could u pls send me the source code
source code
source code  sir...i need an online shopping web application on struts and jdbc....could u pls send me the source code
source code
source code  hellow!i am developing a web portal in which i need to set dialy,weekly,monthly reminers so please give me source code in jsp
source code
source code  how to get the fields from one page to another page in struts by using JSTL
Implementing Digits restriction Using JQuery
Implementing Digits restriction Using JQuery  Hi Sir I have.... Please provide code.   You can implement these two things using ASCII code & parseint method. Code is provided below : //called when key is pressed
source code
source code  how to use nested for to print char in java language?   Hello Friend, Try the following code:ADS_TO_REPLACE_1 class UseNestedLoops{ public static void main(String[] args){ char[][] letters
get the servlet feature - JSP-Servlet
get the servlet feature  when the servlet get servlet feature?  Hi Friend, Please clarify your problem. Thanks
source code wanted
source code wanted   ""how? to" search[or]display" the particular data in MS-ACCESS database please explain the problem and to give the source code... database please explain the problem and to give the source code by only using on swing
java source code
java source code  java source code to create mail server using struts2
I nedd Paypal processing source code in struts and how to develope weather reports using web-api - Struts
I nedd Paypal processing source code in struts and how to develope weather reports using web-api  I nedd Paypal processing source code in struts and how to develope weather reports using web-api
source code for the following question
source code for the following question  source code for the fuzzy c-means
Java source code
Java source code  How are Java source code files named
request for java source code
request for java source code  I need source code for graphical password using cued-click points enabled with sound signature in java and oracle 9i as soon as possible... Plz send to my mail
Java Source code
Java Source Code for text chat application using jsp and servlets  Code for text chat application using jsp and servlets
source code in jsp
source code in jsp  i need the source code for online payment in jsp
Hiding Source Code - WebSevices
Hiding Source Code  Is there any way to prevent viewing source code in browser
java/j2ee source code
java/j2ee source code  java/j2ee source code for online food purchasing service with my sql database
source code - JDBC
source code  give me a source code to connect from java to mysql that can run on eclipsed i am using mysql-essential-5.0.41-win32_1. also give procedure how can i connect from eclipsed to mysql-essential-5.0.41-win32_1. thanks
source code - Swing AWT
source code  source code for a program to shutdown, restart, log off the pc after clicking jbutton on jpanel or a jframe by user. thanks in advance
Searching for Code - JSP-Servlet
JSP, Servlet Searching for Code  Hi, i am looking for a jsp servlet code examples for the search function in my application.Thanks
implementing an algorithm using multi threads - Java Beginners
implementing an algorithm using multi threads  Hi i need to implement an algorith in multi threads.Algorithm has data dependency so i need to pass... to calculate execurion time.# Here is my code: import java.io.*; class MT

Ads