aspose file tools*
The moose likes JDBC and the fly likes Exception :[ODBC Driver Manager] Data source name too long Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exception :[ODBC Driver Manager] Data source name too long" Watch "Exception :[ODBC Driver Manager] Data source name too long" New topic
Author

Exception :[ODBC Driver Manager] Data source name too long

swarup reddy
Greenhorn

Joined: Jan 22, 2007
Posts: 14
Hi
I get the below error when i execute my JDBC code.

***Exception:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long

Below is the try block which results in the error



I have googled the error and found mention about SQL_MAX_DSN_LENGTH in sqlext.h . This header file exists in the dump, but is missing in the installed directory of SQL Server.

Can someone please explain the error.

Thanks
Swarup
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

I'm sorry, this sounds like a software configuration issue rather a programming issue, you might try an MS support forum. All I can recommend is reinstalling SQL Server.


My Blog: Down Home Country Coding with Scott Selikoff
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

DSN is outside SQL Server's control so I don't know if a reinstall will help (also, this file is in none of the SQL Server installs I can currently see). What you could do it use a proper type 4 driver then you don't need DNS.
[ July 18, 2007: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
swarup reddy
Greenhorn

Joined: Jan 22, 2007
Posts: 14
Paul, Scott
Thanks for your responses.
I shall try by modifying SQL_MAX_DSN_LENGTH in sqlext.h and then doing a reinstallation. But this is not a good idea because the program has to be run on the Server machine, where it can run into the same issue.

I shall try to follow paul's idea and check it out.

Thanks
Swarup
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception :[ODBC Driver Manager] Data source name too long