-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Selecting data using a Date Column
PostPosted: Mon Feb 21, 2005 10:40 am 
Newbie

Joined: Thu Oct 07, 2004 9:15 am
Posts: 5
Hello,

I'm querying my oracle database using different search criteria from the user input. In the database i have a table called Deals and in this table a column field called COBDATE, which is mapped using java.util.Date to the corresponding java class. I can query using any column/attribute but i get errors every time i query by cobdate.

The user input comes in a calendar format that i can pass to String. This String looks like '20050221'. I convert it to java.util.Date using:

java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyyMMdd");
java.text.ParsePosition pos = new java.text.ParsePosition(0);
Date currentTime_2 = formatter.parse(cobdate, pos);


I then query where COBDATE property is like currentTime_2, getting errors and not returning anything.

Do you query the database selecting data for a specific date? If so, how do you do it? Do i have to use java.sql.Date?

thanks a lot, help is much appreciated


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.