Share on Google+Share on Google+

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

September 8, 2008 at 6:08 PM

Hi Ragini,

Plz specify in detail and send me code.


September 9, 2008 at 9:44 AM

Hello Ragini

See I am create Database named as testing and a Table named MyTable.
Inside this table One column exist named NAME contain value like swaraj, raj, rani etc.

When I am search for a name contain the string, it display me in output raj and swaraj.
if I search for ragini, It disply me No record found.

I give the detail code use this if not getting just callme 9986734636, other connect to my system by remote desktop connection by using

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

public class Test1 {

public void search(){
/* Think this string data from your JSP/Html page or CommandLine
* As per your require You retrive the value and store in a "searchstrin"
* Here I am just assign a string value.
String searchstring = "raj";

* How you want search, its depend upon you.
* A Name Stararted with spacific name or char then USE in SQL Query LIKE 'srchstring%'
* if Ended with specific Name then USE LIKE '%srchstring'
* if it contain the specification then USE LIKE '%srchstring%'
* As per requirement you change the below query
String srch = "select name from Mytable where name LIKE '%" + searchstring + "%'";
* See Here I am Using MySQL.
* So As per Your Database Change Class.forMame(),
* and DriverManager.getConnection().
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/testing";, "root", "");

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(srch);
System.out.println("No Record Found");
* If you think why again i am execute the query?
* Because once using rs.next, It point to next record.
* if any record exist in first row it not consider.
rs = stmt.executeQuery(srch);
}catch(Exception ex){


public static void main(String s[]){
Test1 t = new Test1();


Other Wise Send your code



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>
Ajax type
Ajax type  hiii, Is Ajax a technology platform or is it an architectural style
JSF Internalization - Java Magazine
JSF Internalization  Hiii, please tell me How to JSF Internalization
iphone  hiii, how can we use table recursively in iphone
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
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
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
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
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
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
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
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
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
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
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
method inside the method??
() { System.out.println("hiii..."); } } } not getting compiled y
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
DML and DDL   hiii, Explain DML,DDL.   HELLO, Data Definition Language (DDL) statements are used to define the database structure or schema. CREATE, ALTER, DROP, TRUNCATE, COMMENT, RENAME Data Manipulation Language
Serializalble and Externalizable
Serializalble and Externalizable  hello, What is the difference between Serializalble and Externalizable interface?   hiii, When you use Serializable interface, your class is serialized automatically by default
What is GSM ?
What is GSM ?  hello, What is GSM ?   hiii, The Global System for Mobile Communications (GSM) is a wireless network system that is widely used in Europe, Asia, and Australia. GSM is used at three different


Advertisement null