Re: JDBD: time format



How is the time stored in your database? (What SQL / DDS datatype is
the column?)

What might be happening is that if the Stored Procedure is returning
your time as an SQL Date or SQL Time datatype, the ResultSet
implementation might change your getString() call to a
getDate().toString() call or a getTime().toString() call behind the
scenes. The toString() methods of a java.sql.Date and java.sql.Time
will always return a String using a : as the separator.

It would be nice to get to the bottom of this difference between the
two IBM drivers, but two work arounds suggest themselves:

1) Use String's replace() method to convert the :s to .s (not very
elegant)
2) Use getDate or getTime to retrieve the data, then use a
java.text.DateFormat to convert to a String (but this assumes your
Stored Procedure is returning one of these datatypes, and not just
text)

Walker..

.



Relevant Pages

  • VBA SQL Server Stored Procedure creating a Pivot Table
    ... I have a SQL Server Stored Procedure ... Dim sWorkBookName As String ...
    (microsoft.public.excel.programming)
  • Re: Invalid CastException with SqlDBType
    ... Add(string*, SqlDbType, int, string**) ... The DateTime.Now is trying to cast into a int. ... not in Sql set up the column as identity and let it seed itself. ... > update a MS SQL Database with a stored procedure. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: SQL 2000: Inserting multiple rows into a single table
    ... and my question is on the order details. ... > to set up a stored procedure that essentially inserts in the orders ... I also need to do this via SQL 2000. ... > me a string of data per column for order details, ...
    (microsoft.public.sqlserver.programming)
  • Re: Stored Procedures
    ... Looking at your SQL statement, a "normal" stored procedure won't be ... Public Function vLookup(ByVal table As String, ... Dim StringToReturn As String ...
    (microsoft.public.dotnet.languages.vb)
  • Re: XML Message to SQL in Attribute
    ... You are on the right track, with sending Xml to a SQL stored procedure. ... The XmlParser that writes the string encodes the string. ...
    (microsoft.public.biztalk.general)