• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Uniqueidentifier column type is not supporting in prepared statement

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks

I have an issue with storing uniqueidentifier column in Database using prepared statement.

Am using postgre sql database, in postgres we have one uniqueidentifier column type and am using it.
while inserting uniqueidentifier column as string or object using prepared statement it is throwing exception like



here is the sample code :




if the column type is string/int/object i can able to store using prepared statement, but because of uniqueidentifier type am not able to insert into DB.

Could anyone of please give me some idea how to do it using JDBC.

I really appriciate if anyone having any suggestion.


 
author & internet detective
Posts: 40801
829
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naresh,
I went through this yesterday for Timestamps. (postgresql is WAY to picky with types.) I haven't had occasion to try for Unique Ids but searched and found this. The suggestion is to use setObject which sounds reasonable.
 
Naresh Talluri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne

Thank you for your suggestion, but i tried with setObject() as well, and i followed the link and tried as they shown example.


but this is also not work it out.

Could you please let me know if you have any other ideas..

Thank you for your reply.

 
reply
    Bookmark Topic Watch Topic
  • New Topic