This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Doubt in retrieving data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Doubt in retrieving data" Watch "Doubt in retrieving data" New topic
Author

Doubt in retrieving data

Arun Kumar Gaddam
Ranch Hand

Joined: May 05, 2007
Posts: 58
DriverManager.getConnection(...........);
System.out.println("connected-->");
String check="Arun";
String vsql="select * from phoneproj where cont_name= __________";
Statement stmt= con.createStatement();
ResultSet rs= stmt.executeQuery(vsql);

Now what can i add in the blank to retrieve data whose contact name is Arun.
i can't able to write .....any one please help......thanks in advance
javascript: x()
banghead
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
"select * from phoneproj where cont_name='"+check+"'";

Regards

Jetendra


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Doubt in retrieving data
 
It's not a secret anymore!