Hi,
I'm working on a database conversion from Sybase to SQL Server 2005 and have hit a wall with a character conversion problem when reading non-ASCII characters (encrypted password) via JDBC.
My application runs on Solaris and accesses a SQL Server 2005 database via the Microsoft JDBC driver. The server was unfortunately specified as having a SQL_Latin1_General_CP1_CI_AS collation at installation time, and the database being accessed has taken this default. After creation the data was migrated across via DTS.
The invalid character is a dagger '?'. When read over JDBC it is converted to a question mark '?'.
In my original environment a Sybase database was accessed via JDBC driver from Solaris and the correct value was returned. The Sybase database used Latin1_General_BIN as it's collation. By way of experimentation I have modified the default collation sequence within the SQL Server 2005 database, and created a new table to hold the password. I am then able to correctly return strings containing this character from within SQL Server Management Studio, but the same problem still exists when accessing it via JDBC.
I am not sure where to focus my investigation and would be grateful for any useful pointers/advice. To me it looks like it's a JDBC driver issue as with the change in collation it works from a non-JDBC client.
Many thanks
Alistair
Just to make sure we are on the same page, are you using the Microsoft 2005 Jdbc driver?
http://msdn.microsoft.com/data/ref/jdbc/
We have just shipped the June community tech preview of this driver if you want to play with the latest and greatest:
http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en
The Microsoft 2000 Jdbc driver is not supported here. If you are using the latest driver do you have some code that inserts the invalid data into the database and then returns it incorrectly? I would be happy to take a look at this.
|||Thank you for the reply. I have been using the 2005 driver, but have managed to resolve the problem by changing the column data type to a binary rather than varchar.
Out of interest do you have any idea when the new driver will go on general release?
|||Glad to hear you got this working!
We are currently working on shipping the v1.1 release of the 2005 JDBC driver, of course I can't promise anything but we are targetting an August release date.
|||Hi,
Please can you update me on the shipping date for the v1.1 release of the 2005 JDBC driver? Is it likely to be within the next couple of weeks?
Regards,
Alistair
|||Hi Alistair,
Yes, the v1.1 release should be available within the next couple of weeks. It may even be available as early as next week.
Thank you,
--David Olix
JDBC Development
sql
No comments:
Post a Comment