Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners 1536-Source-Code-for-Implementing-Search-Feature-in-JSF Source Code for Implementing Search Feature in JSF/JSP using Servlet
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Cindy
Source Code for Implementing Search Feature in JSF/JSP using Servlet
1 Answer(s)      6 years and 5 months ago
Posted in : Java Beginners



Advertisement
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
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
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  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  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
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  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
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
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
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
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
get the servlet feature - JSP-Servlet
get the servlet feature  when the servlet get servlet feature?  Hi Friend, Please clarify your problem. Thanks
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 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
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
download code using servlet - Servlet Interview Questions
download code using servlet  How to download a file from web to our system using Servlet
Source code
Source code  source code of html to create a user login page
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
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
source code
source code  how to get the fields from one page to another page in struts by using JSTL
either jsf or jsp?
either jsf or jsp?  which is better technology to display dynamic data by using either jsf or jsp
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
Advertisements
 

 

 

DMCA.com