× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Wayne,

On 10/14/2013 9:10 AM, Wayne Achenbaum wrote:> com.microsoft.sqlserver.jdbc.SQLServerException: Implicit
> conversion from data type xml to nvarchar

My JDBCR4 tool asks the JDBC driver (Java database) to convert all data types to a character field, this way my JDBCR4 routine doesn't need to have different "get" routines for every single data type.

The error message means that the data type you're retrying to retrieve cannot be converted to character. Based on the error message, I looked to see if I could find the standard Java routine to retrieve an XML field (and to see what data type an XML field would retrieve!) but, interestingly enough, XML is not one of the data types that is available in the JDBC standard.

After digging further, I discovered that this is in fact a Microsoft-specific data type. So to make this work, you'll have to prototype and call the proprietary Microsoft SQL Server routines to get/retrieve this type of data. Details on what those routines are can be found here:
http://technet.microsoft.com/en-us/library/ms378680.aspx

Unfortunately, this is something I've never done, and I don't have sample code for you. Indeed, I've never used a SQL server database -- JDBCR4 is designed to be generic, able to handle any data base, and I've always used it for MySQL. Many others are using it successfully with SQL Server -- but not with this XML data type, so I don't have any sample code to give you.

But, it should definitely be possible, you just have to write the routines...



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.