This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
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


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

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: 62106
    
  68

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