-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: UUEncode MySql+Hibernate+Big5 Problem
PostPosted: Fri Mar 25, 2005 3:26 am 
Newbie

Joined: Wed Feb 23, 2005 10:36 pm
Posts: 7
Location: Taipei
Honestly I am not sure if this is the right place to post this question of mine.

We are using MYSql compiled with Big5. We had problems inserting images thru our stand-alone application written in C++ so we UUEncode it and saved as Blob. From that stand-alone app we were able to save them and retrieve and display them.

Do I need to do special mapping and stuff or special SQL to UUDencode it using Hibernate? I have tried doing it from java using UUDecode but the image is broken. Do I UUDecode it from Hibernate or SQL? if so how?

Thanks!!!

_________________
The button for mass destruction


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 25, 2005 5:49 pm 
Beginner
Beginner

Joined: Tue Jun 29, 2004 3:44 pm
Posts: 43
You will do this yourself. You can either write methods into your class that get and set the image via the UUencoded String (and map the String in your Hibernate mapping files), or you can write your own UserType and use that to convert the image back and forth when Hibernate gets or sets the image. The second way is probably best and has no impact on your domain objects, but it will involve learning to implement UserType.

hth,
Scott


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 26, 2005 1:05 pm 
Newbie

Joined: Wed Feb 23, 2005 10:36 pm
Posts: 7
Location: Taipei
scott,

thanks man.

But after almost a day of doing tests, we found out that the C++ library was the culprit. It can insert and retreive the image correctly. But when we do it thru java, and even from the command line, images are broken.

This encoding problem really sucks... we were able to store and display chinese texts but images cant be stored if the DB is compiled with Big5.

Thanks again

steve

_________________
The button for mass destruction


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.