Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes problem in where clause Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem in where clause" Watch "problem in where clause" New topic
Author

problem in where clause

gaurav chhabra
Ranch Hand

Joined: Jul 24, 2004
Posts: 109
hello sir
i m using the query....

String q1 = "select id from experience where years =" + name1 & "months ="+name2 ;

it is givig error at "&".plz tell me the exact query....
thank you
gaurav
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Originally posted by gaurav chhabra:


String q1 = "select id from experience where years =" + name1 & "months ="+name2 ;

it is givig error at "&".plz tell me the exact query....



gaurav '&' is used in VB I think

This should be something like



Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Anandh Ramesh
Ranch Hand

Joined: Dec 15, 2004
Posts: 61
hi,

the '&' symbol is not supported by sql. use the word 'and' instead...

all the best...


cheers,<br />Anandh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in where clause
 
Similar Threads
oops..
query error...
how to read few records at a time?
loops in java
How to convert an Object to integer?