• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
adrian mills
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!