dcsimg
16byte limit on writing to ntext fields to MSSqlServer using jdbc.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Saintloth
Posted On:   Sunday, July 28, 2002 11:36 PM

Hi, I am building a web application that provides support for several large databases including Microsofts Sql2000. I am able to create rows of data on the dbase using JDBC but I noticed two things, 1) When attempting to write more than 16bytes of data to an ntext field the additional data is truncated away to oblivion. 2) When attempting to retrieve the stored data (from the same ntext field), all I get back are numbers (digits) I am unable to retrieve the stored text, even though the query analyzer shows it to be text ...the java method extraction from the result set (using getTe   More>>


Hi,

I am building a web application that provides support for several

large databases including Microsofts Sql2000. I am able to create rows


of data on the dbase using JDBC but I noticed two things,



1) When attempting to write more than 16bytes of data to an ntext


field the additional data is truncated away to oblivion.







2) When attempting to retrieve the stored data (from the same ntext


field), all I get back are numbers (digits) I am unable to retrieve


the stored text, even though the query analyzer shows it to be text


...the java method extraction from the result set (using getText() )
returns a string of digits.



I fear it might be the driver I am using to talk to the MS Sql server


(jdbc odbc bridge driver..) but i am hoping that's not the case..as


far as I can see this should work fine. I am able to return strings


properly from fields of type nchar and nvarchar but ntext fields


ellicit the previously mentioned difficulties. Any assistance that can


be provided would be much appreciated.





Regards,





Dsl

   <<Less

Re: 16byte limit on writing to ntext fields to MSSqlServer using jdbc.

Posted By:   David_Saintloth  
Posted On:   Sunday, August 4, 2002 10:06 PM

I answered this question here:
The Answer



Basically, the jdbc odbc bridge driver is lame, it doesn't
support a ton of usefull features that any basic
application developer would maybe want support for in
a generic dbase. In my case, this was support of blob
and clob type data fields, the driver didn't know
how to handle transforming these data types to java.



The solution, was to simply download better drivers! I was
testing my app. with a MS SqlServer2000 dbase to start
so I went to MS looking for a jdbc driver and sure
enough they had posted one some time in may, I
downloaded it hoping it would support extraction of
clob and blob type fields (ntext is one of these datatypes)..so anyway I downloaded it, installed the
package in my classpath and switched my apps. dbase xml file (xml rocks for application configuration files..)
and tried the test...well it didn't work ..but the reason why is specified more fully in the link I provided
earlier, needless to say after that tweak was performed on the dbase
box it worked fine. If you are having similar issues, and are getting "unsupported feature" errors, most
likely you have to get a better driver from the dbase vendor itself or there are some thirdparty guys that will
give you an all in one driver ...for a fee of course!



Here's a link to Sun's website driver finder tool, FIND DRIVERS

That is all..



Regards,

Dsl

About | Sitemap | Contact