File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Plz check the syntax: Whats wrong 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 "Plz check the syntax: Whats wrong" Watch "Plz check the syntax: Whats wrong" New topic

Plz check the syntax: Whats wrong

Gorakshanath Pandey

Joined: Feb 25, 2004
Posts: 11
selopen=" select count(*) from country "
+ "where region =" + "'" + temprs.getString("region") + "'"
+" and W_cmr = 'L' and closed_dt between " + "'"
+ dtrs.getDate("stdate") + "'" +" and "
+"'" + dtrs.getDate("eddate") + "'";
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
Are you getting a compile error? An SQL error? A JDBC error? no results back on the query? Please post the error you are receiving, and where/when it occurs.
Also, what database are you using? You have to be careful about how you specify dates on most databases: yours might not like a date to be specified as a quote-delimited string unless it's in a very specific format.
[ March 08, 2004: Message edited by: Wayne L Johnson ]
I agree. Here's the link:
subject: Plz check the syntax: Whats wrong
It's not a secret anymore!