Sql 7 date
montsman at longbow.com
Wed Sep 26 16:14:12 EDT 2001
hehe, neah, mood is fine, typo :)
Anyways, the field is datetime, and yes, ordinarily I would just use
ResultSet.getDate or something like that to retrieve it.
The real problem is that I don't know what type of field I am dealing with
ahead of time. In this application I am working on, I am looping through all
of the fields in a given table and try to determine their data types. When I
call ResultSetMetaData.getColumnType on the datetime field, it throws
exception saying that it can't determine the type.
So then I started thinking of how to hack it and perhaps retrieve the date
as a string as and then cast it into a date, but none of the built in java
Date classes seem to recognize a date like: '2001-03-03 00:00:00.0' as a
Hope I am more clear now :)
----- Original Message -----
From: "Curt Hagenlocher" <curt at hagenlocher.org>
To: "TDS Development Group" <freetds at franklin.oit.unc.edu>
Sent: Wednesday, September 26, 2001 3:50 PM
Subject: [freetds] Re: Sql 7 date
> "Mark Lontsman" <mark.lontsman at longbow.com> wrote:
> > Hell everyone,
> In a bad mood, are we? ;)
> > Can someone give me pointers on how to deal with Sql Server 7 dates
> > in jdbc implementation of freetds?
> I have to confess that I don't understand your question.
> Is your field a datetime/smalldatetime? Or is it a char
> field that is being used to store date and time information?
> If it's a datetime, you should just be able to call
> ResultSet.getTimestamp to get its value. If that value
> is null, then the field is null.
> If it's a char field, then you might be able to use the
> java.util.DateFormat class to parse the date and determine
> its validity. (Naturally, you'd need ResultSet.getString
> to get the value.)
> If neither of these describes what you are trying to do,
> you'll have to be more explicit.
> Curt Hagenlocher
> curt at hagenlocher.org
> You are currently subscribed to freetds as: [mlontsman at longbow.com]
> To unsubscribe, forward this message to
More information about the FreeTDS