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.  [ 4 posts ] 
Author Message
 Post subject: Reading an NTEXT field
PostPosted: Wed Aug 31, 2005 10:59 am 
Newbie

Joined: Wed Aug 31, 2005 10:41 am
Posts: 10
Location: Colombia
Hello, I have a problem trying to read a NTEXT field from a SQLServer database using the jTDS driver. This field contains a Excel file that was written as a byte array.

Initially I mapped the corresponding field to the types 'string' and the property was defined as java.lang.String. The field was read and store in the String property, but when i tried to write it to the file system, the resulting xsl file was incorrect.

Then, i changed the mapping to hibernate type 'text' but i received a ClassCastException.

Does someone have a idea about reading ntext fields?

Thanks a lot

_________________
Johannes Correa Lopera
Software Engineer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 1:11 pm 
Newbie

Joined: Wed Aug 31, 2005 11:20 am
Posts: 13
Why don't you use a Blob instead of NTEXT, if I got it right, NTEXT contains a variable number of unicode character when an Excel file contains binary values.

Try using a Blob type and use a byte array to retrieve your Excel file. It should be really simple to create your excel file from a byte array after retrieving it correctly form your SQL Server.

I hope this helps you out.

Francois Archambault


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 1:21 pm 
Newbie

Joined: Wed Aug 31, 2005 10:41 am
Posts: 10
Location: Colombia
francois.archambault wrote:
Why don't you use a Blob instead of NTEXT, if I got it right, NTEXT contains a variable number of unicode character when an Excel file contains binary values.

Try using a Blob type and use a byte array to retrieve your Excel file. It should be really simple to create your excel file from a byte array after retrieving it correctly form your SQL Server.

I hope this helps you out.

Francois Archambault


Thanks a lot Francois for your answer, but i have a trouble because that field is used by another VisualBasic application and my app is just an only-read client and i don“t think it could be possible to change the field. Do you have any other idea?

_________________
Johannes Correa Lopera
Software Engineer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 1:38 pm 
Newbie

Joined: Wed Aug 31, 2005 11:20 am
Posts: 13
And the VisualBasic application manage to build and store an Excel file from/in a NText datatype field ?

Do you have access to the VB code that use that field ? It is probably the key to your problem.

I would like to help further, but I have never used a NText field and furtherless used it to load an Excel file.

Good luck with this.

Let us know if you find a way to solve this.

Francois Archambault


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.