Share on Google+Share on Google+

Ragini Shukla
2 Answer(s)      8 years ago
Posted in : Java Beginners
View Answers

September 9, 2008 at 3:05 PM

Hi friend,

Please give in details and technology u have problem.


September 9, 2008 at 4:18 PM

hello Ragini

You not mention on which technologies need Solution.
The Given code is 200% ok;
Any How I give the code below contain two jsp Page. In one you enter your data and click , it will redirect to another jsp where you got the out put.
For this You Create Project in this Structure
MySql Jar File
Deploy this and run in browser

Here The Code


<form action="page2.jsp">
<input type="text" name="srch">
<input type="submit" value="submit">


<%@ page import="com.Test2" %>
String name = request.getParameter("srch");
Test2 test2 = new Test2();


package com;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Test2

private String vend_name;

public void setString(String name){
vend_name = name;
System.out.println("vendname " + vend_name);

public String search()
StringBuffer sb = new StringBuffer("");
String srch = "select name from Mytable where name LIKE '%" + vend_name + "%'";
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/testing";, "root", "");

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(srch);
"Sorry! No Record Available.</FONT></TD></TR></TABLE>");
return sb.toString();
sb.append("<TABLE BORDER BGCOLOR="+"#00b8ff"+" ALIGN=CENTER>\n");
rs = stmt.executeQuery(srch);
sb.append("<TR ALIGN=CENTER>\n");
sb.append("<Td>" + rs.getString("name") + "</td>");
return sb.toString();
}catch(Exception ex){
return ("<PRE> Error :"+ex.toString()+"</PRE>");




Related Tutorials/Questions & Answers:
Hiii...  How to display blinking character in html?   User blink tag to blink any string or chracter. <html> <title>Blink Text</title> <body> <blink>Welcome To Roseindia</blink>
iphone  hiii, how can we use table recursively in iphone
JSF Internalization - Java Magazine
JSF Internalization  Hiii, please tell me How to JSF Internalization
Ajax type
Ajax type  hiii, Is Ajax a technology platform or is it an architectural style
HEAP table
HEAP table  hiii, What is HEAP table?   hello, This type of table is stored in the memory. Speed of execution of this table is very commendable
Icon image
Icon image  hiii how can we set image on the icon by which we can launch the application???   hello, when you will save a image named icon.png then it is automatically show this image on the icon
What is ETSI ?
What is ETSI ?   hiii, What is ETSI ?   hello, ETSI stands for European Telecommunications Standards Institute. This is a non-profit organization that establishes telecommunications standards for Europe
file i/o - Java Beginners
file i/o  hiii, i have to read some integers from a text file and store them in link list.. so please can i have source code for it.?? thanks
Implement the Serializable Interface
Implement the Serializable Interface  hii How many methods do u implement if implement the Serializable Interface?   hiii, The Serializable interface is just a "marker" interface, with no methods of its own
What is Dojo?
What is Dojo?   hiii, What is Dojo?   hi, Dojo is a third-party javascript toolkit for creating rich featured applications. Dojo is an Open Source DHTML toolkit written in JavaScript
lock on a class
lock on a class  hello, Can a lock be acquired on a class?   hiii,, Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object
want help regarding a project
want help regarding a project  hiii this is hemangi and I want guidance that I am working on a project of hospital management system so I want guidance that how can i implement that in swings or with other frame work? and any
method inside the method??
() { System.out.println("hiii..."); } } } not getting compiled y
string to float
string to float  hiii. how can i change my string value in float for some operation?? give me some code for this??   hello, if rate is your textfield then float FloPri = [rate.text floatValue]; the value
concat and append
concat and append  hello, What is the difference between concat and append?   hiii, Concat is used to add a string at the end of another string.But append() is used with String Buffer to append character sequence
pixel into xml - XML
pixel into xml  hiii can i store image pixels in a xml file and access easily... suggest the better way...  hi friend, 201 171 81 203 175 78 210 176 87 198
Active vibration
Active vibration  hello is it possible to active vibration from code ? if yes give me solution!!!   hiii To trigger vibration in iPhone, use System Audio Services (AudioToolbox/AudioServices.h). Call
Resource files in iphone
Resource files in iphone  hiii how can we use resource files in iphone development ???   hello, if you want to use any file in your application the first you have to added it in your resource folder .. right click
Basic for iphone development??
Basic for iphone development??  hiii... I want to go for iphone development .. What are the basic for iphone development can some body tell me...?????   hello, if you want to go in iphone development then i
Dirty page and Dirty report
Dirty page and Dirty report  hiii, Explain dirty page and dirty report?   hello, Dirty Pages: Data that which is modified and Stored in the buffer cache but has not yet been written in to the secondary storage
servlet - JSP-Servlet
servlet  hiii.....!!! pls help me answering this.... what can be the xml code which will describe a servlet and mapps an instance of it with specific url..???  Hi friend, Servlet