Friday, February 24, 2012

Issue using the JDBC driver to connect to a remote server

Hi All,

We have a customer in Japan who's using our tool to connect to their SQL Server. Our application runs on a Linux machine and uses the MSSQL JDBC driver for connectivity.

We're getting errors back that are not-decipherable because, I presume, they're in Japanese, and then our logs don't log them in Unicode, so they get flattened out as question marks. The errors come out looking something like this:

Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]? 'MSSQL'

?

SQL State: HY000

SQL Code: 4060

[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]? 'sa' ?

SQL State: 28000

SQL Code: 18456

[Microsoft][SQLServer 2000 Driver for JDBC]An error occured while attempting to

log onto the database.

SQL State: 08001

SQL Code: 0

I think we could troubleshoot the problem if we could only read the errors coming back. I know in the ODBC world there are options like "Change the language of SQL Server system messages" and "Perform transaltion for character data" in the ODBC control panel. I couldn't find any similar options available in the JDBC driver however. Do they exist?

Even if they don't, just scanning the messages makes it pretty clear that there's an authentication/permissions issue at work here. We have another app using the same credentials that works fine though - so if there are any known issues about using JDBC to authenticate in a multi-lingual environment, that would be helpful too. Our tcpdumps seem to suggest that the JDBC driver is using multi-byte strings when communicating with the server, however the "working" application is using single-byte encoding. Could that be why we're not authenticating? How is that controlled? Note that at this point I'm just talking about authentication, not the codepages/encodings of the data in the database - right now I'm just worried about logging in.

Thanks!
Tom

I do not think app using single byte encoding should make any difference when logging in. You really should get the error string in English to understand what is going on.

|||

Error 4060 is "Cannot open database "..." requested by the login. The login failed.", 18456 is "Login failed for user ...".

I am moving to the "SQL Server Security" forum for further follow-up.

No comments:

Post a Comment