• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Storing a java.lang.Object in MySQL and retreiving it

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


I am trying to store an java.lang.Object in MySQL database using CMP 2.0 and JBoss App Server.
There is a xml String in this Object.
When I retreive the Object by using

String obj = new String(resultSet.getBlob(4).getBytes(1,(int)resultSet.getBlob(4).length()));

the above code.
I have some unecessary data at the start inbetween and at the end of the String Object which I saved.
Can anyone tell me why this is happening.
Does anyone have the code to retrieve a blob from MySQL using JDBC?


Thanks for all your help in advance.
Waiting for all your suggestions
With Regards
Adrian
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic