It's not a secret anymore!
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

correct syntax

kelly devon
Ranch Hand

Joined: Apr 15, 2004
Posts: 77
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.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

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

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: correct syntax
It's not a secret anymore!