开发者

[Microsoft][ODBC Driver Manager] Invalid string or buffer length ON WINDOWS SERVER 2008

My java webapp is working fine in my windows XP 64bit with System DSN, by deploying manually in tomcat.

When i am running my webapp in Tomcat on windows server 2008 64bit. I am using a System DSN, because with user DSN it's not detecting the datasource. In this scenario it is throwing me an error as follows:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length 

So far I have t开发者_Go百科ried:

  1. I compared SQL server and DSN registry values, and they are same.

  2. I deployed on other XP machine, it's working fine but not on Windows Server 2008

Thank you in advance.


When trying to run query against System ODBC DSN (MS Access .mdb file) from an app deployed to Jboss 4.x, I get same error: "SQL state [S1090]; error code [0]; [Microsoft][ODBC Driver Manager] Invalid string or buffer length" in Windows Server R2. I reproduced same error on 2 different Windows Server R2 machines. On Windows Server Standard (i guess R1) and Windows 7 Professional x64 the problem is not reproducible. Further more, on same Windows Server R2 when trying to connect directly (from a standalone app), i don't get this problem. If the application wouldn't connect/detect data source, you'd get an error saying that there is no such DSN name or it's not found. The same error message is thrown when trying to send an empty query to ODBC Data Source (registered Data Source Name - DSN). So i guess the ODBC gets an empty query which tries to execute against the DS and the result is: Invalid string or buffer length.
Since i can read the .mdb file registered as a ODBC DS with given DSN, and i don't get this error when querying it from the standalone app, i'm going to make a standalone app that will read the .mdb file through ODBC and write it's content to a .csv file, which Jboss apps will read. If anyone finds a better solution, please let me know.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜