-
Comparing oracle date with java util
Hi,
I am currently doing a little web-based project of my own and have some trouble comparing a java.util.date with an oracle Date field. It gives the error that SQL command is not properly ended when I try to do so:
java.util.Date newDate=new java.util.Date();
ResultSet rset = stmt.executeQuery ("SELECT DISTINCT issue_dt FROM passcard WHERE passcard.expire_dt>"+newDate);
Have tried formatting it with:
SimpleDateFormat sdf=new SimpleDateFormat("d-MMM-yy");
as the db format is 7-MAY-04,
but that doesn't seem to work as yy is recognised as an illegal character in the database.Thanks in advance and would be grateful for any help given.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks