[jdom-interest] Modified ResultSetBuilder Was [ ResultSetBuilder and Date Problems]

Abhishek Srivastava abhisheks at india.hp.com
Sun May 27 08:47:22 PDT 2001


>>>not sure this
>>>is possilbe though. If you do and it makes dates interchangeable, let us
>>>know!

I modified the ResultSetBuilder.java. Now I am able to extract the date from
the DB and put it back in without getting exceptions.

I have used the MetaData only for date related data types... as the other
data types the to and fro conversion from String is easy... so I felt that
meta data might not be needed for them.

Have a look at the code.

regards,
Abhishek.

>>>-----Original Message-----
>>>From: jdom-interest-admin at jdom.org
>>>[mailto:jdom-interest-admin at jdom.org]On Behalf Of
>>>philip.nelson at omniresources.com
>>>Sent: Saturday, May 26, 2001 6:44 PM
>>>To: abhisheks at india.hp.com; jdom-interest at jdom.org
>>>Subject: RE: [jdom-interest] ResultSetBuilder and Date Problems
>>>
>>>
>>>
>>>> I successfully converted a JDBC ResultSet into a JDOM
>>>> structure. The XML
>>>> produced looks as follows
>>>> <result>
>>>> 	<entry>
>>>>         <CREATED_AT>Thu May 24 00:00:00 GMT+05:30 2001</CREATED_AT>
>>>> 	</entry>
>>>> </result>
>>>>
>>>> Now I want to read this XML and insert into another DB
>>>>
>>>> But when I try to convert the String (CREATED_AT) produced by
>>>> the ResultSet
>>>> Builder into a date I get an exception.
>>>>
>>>> How Can I convert the string produced by the ResultSet Builder into a
>>>> java.sql.date ?
>>>
>>>Not having worked with ResultSetBuilder, I can't comment specifically on
>>>that.  I can say with absolute certainty that database date formats are a
>>>mess.  XML schema is struggling with pretty much the same issue.
>>>
>>>My best advice is to have the database format the date closer to what you
>>>want with a database function call in the query that builds your
>>>result set.
>>>
>>>
>>>ResultSetBuilder does a getString on each column.  You could
>>>choose to try
>>>to enhance the code if you like and use the metadata to
>>>determine the column
>>>type and then vary behaviour when a date column appears. I am
>>>not sure this
>>>is possilbe though. If you do and it makes dates interchangeable, let us
>>>know!
>>>_______________________________________________
>>>To control your jdom-interest membership:
>>>http://lists.denveronline.net/mailman/options/jdom-interest/youra
ddr at yourhost.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ResultSetBuilder.java
Type: application/octet-stream
Size: 14145 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010527/2ab9da44/ResultSetBuilder.obj


More information about the jdom-interest mailing list