Re: Bad Value for Data Type Timestamp - Mailing list pgsql-jdbc

From Jonathan Vallar
Subject Re: Bad Value for Data Type Timestamp
Date
Msg-id 6c1017c20602282254p3706fad2vc3cbe7f4ad81a3b4@mail.gmail.com
Whole thread Raw
In response to Re: Bad Value for Data Type Timestamp  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Bad Value for Data Type Timestamp
List pgsql-jdbc
Hmmm.. I do not know how to display the actual value because the java program is an IBM product (IBM Websphere WBI). I created a java program that connects to the same postgres database and access the same table and parse the field with the timestamp data type. From my program, I have no problem with the field. I used the java.sql package of java together with the JDBC driver. Attached is the program I made. Am not sure on how to replicate the said problem encountered on the IBM product (which is listed below)

Since the problem occurred here " org.postgresql.jdbc2.TimestampUtils.loadCalendar(TimestampUtils.java:151)", I assume that the problem happened while processing the timestamp field.

Retrieve Operation failed on the BusinessObject Bad value for type =
timestamp : [C@56c55d28  Exception: java.lang.NumberFormatException: =
Expected time to be colon-separated, got ' Stack Trace:  =
java.lang.NumberFormatException: Expected time to be colon-separated, =
got '  at =
org.postgresql.jdbc2.TimestampUtils.loadCalendar(TimestampUtils.java:151)=
   at =
org.postgresql.jdbc2.TimestampUtils.toTimestamp(TimestampUtils.java:307) =
  at =
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp (AbstractJdbc2Res=
ultSet.java:419)   at =
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getTimestamp(AbstractJdbc2Res=
ultSet.java:2088)   at =
com.crossworlds.connectors.JDBC.JDBCBOhandler.doContainerRetrieve(JDBCBOh=
andler.java:3697)   at =
com.crossworlds.connectors.JDBC.JDBCBOhandler.doRecursiveRetrieve(JDBCBOh=
andler.java:3316)   at =
com.crossworlds.connectors.JDBC.JDBCBOhandler.doRetrieve(JDBCBOhandler.ja=
va:3265)   at =
com.crossworlds.connectors.JDBC.JDBCBOhandler.doVerbFor(JDBCBOhandler.jav=
a:1346)   at =
com.crossworlds.cwconnectorapi.CWConnectorBOHandler.doVerbFor(CWConnector=
BOHandler.java:127)   at =
CxCommon.BusinessObject.doVerbFor (BusinessObject.java:2128)   at =
com.crossworlds.cwconnectorapi.CWConnectorBusObj.doVerbFor(CWConnectorBus=
Obj.java:126)   at =
com.crossworlds.connectors.JDBC.JDBCConnectorAgent.pollForEvents(JDBCConn=
ectorAgent.java :1137)   at =
AppSide_Connector.BusObjJavaInterface.poll(BusObjJavaInterface.java:355) =
  at AppSide_Connector.AppCalls.poll(AppCalls.java:191)   at =
AppSide_Connector.AgentBusinessObjectManager.poll(AgentBusinessObjectMana=
ger.java:719)   at =
AppSide_Connector.AppPolling.poll(AppPolling.java:294)   at =
AppSide_Connector.AppPolling.doPollingContinuousWait(AppPolling.java:556)=
   at AppSide_Connector.AppPolling.run(AppPolling.java :121)   at =
java.lang.Thread.run(Thread.java:513)  End of Stack Trace   SQLException =
{2}]

Here is the sample data of the table:

wbi_db=>
wbi_db=> \d xworlds_events;
              Table "public.xworlds_events"
     Column     |            Type             | Modifiers
----------------+-----------------------------+-----------
 event_id       | bigint                      | not null
 connector_id   | character varying(40)       |
 object_key     | character varying(80)       | not null
 object_name    | character varying(40)       | not null
 object_verb    | character varying(40)       | not null
 event_priority | real                        | not null
 event_time     | timestamp without time zone |
 event_status   | integer                     |
 event_comment  | character varying           |


Here is the table schema:
wbi_db=>
wbi_db=> \d xworlds_events;
              Table "public.xworlds_events"
     Column     |            Type             | Modifiers
----------------+-----------------------------+-----------
 event_id       | bigint                      | not null
 connector_id   | character varying(40)       |
 object_key     | character varying(80)       | not null
 object_name    | character varying(40)       | not null
 object_verb    | character varying(40)       | not null
 event_priority | real                        | not null
 event_time     | timestamp without time zone |
 event_status   | integer                     |
 event_comment  | character varying           |







On 3/1/06, Oliver Jowett <oliver@opencloud.com> wrote:
Jonathan Vallar wrote:

> Is this the problem? If so, what will I do to solve the problem?

It's not the problem, it would just help in diagnosing the real problem
as we'd be able to see the actual value that is failing to parse.

-O

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Bad Value for Data Type Timestamp
Next
From: Oliver Jowett
Date:
Subject: Re: Bad Value for Data Type Timestamp