File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes correct syntax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "correct syntax" Watch "correct syntax" New topic
Author

correct syntax

kelly devon
Ranch Hand

Joined: Apr 15, 2004
Posts: 75
hi all, please i need help in getting the correct syntax for a select statement that uses where and . what i mean is this; ("SELECT data FROM register WHERE date="+"'"+21+"'"+ AND+ "'"+22+"'"); i cant seem to get it right thank you.


kel
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

Why are you not using a PreparedStatement? You are risking SQL injection by creating statements as you are.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: correct syntax