Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java datetime with sqlserver?

0 views
Skip to first unread message

Luke

unread,
Mar 4, 2003, 11:49:36 AM3/4/03
to
What's the best way for getting datetime values from sql server 7 and
into a java class that has the ability to do date-related
calculations?

I like the java.sql.date class, but it looks like a lot has been
deprecated in 1.4

my goal here is to be able to insert a series of datetime values into
sql server from loops and methods that are doing calculations on the
dates as they are entered.

thanks,
-L

Joseph Weinstein

unread,
Mar 4, 2003, 12:08:07 PM3/4/03
to Luke

Luke wrote:

> What's the best way for getting datetime values from sql server 7 and
> into a java class that has the ability to do date-related
> calculations?

The logical choice for this is ResultSet/CallableStatement.getTimestamp().
The java object java.sql.Timestamp is the appropriate container for
SQLServer datetime/smalldatetime column values.

Joe Weinstein at BEA

0 new messages