aspose file tools*
The moose likes JDBC and the fly likes java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length" Watch "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length" New topic
Author

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

pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
Hi

first i m not able to create datasource using the sql server in System Dsn.
so i have install connecter mysql-connector-java-5.1.15.
And i have create datasource by using option" Mysql odbc 3.51 Driver" in sys dsn.
So it will create successfully.
Initialy I could do practice using these only.
But now i m getting exception "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length"

My System configuration is :
Windows7, win 64

MySQL Server 5.1
Connector ODBC 3.51
java >> jdk1.6.0_35, jre6
tomcat>> apache-tomcat-6.0.35-windows-x64.

Please help , i m stuck here from last tow days.
Thans in advance.
Emanuel Kadziela
Ranch Hand

Joined: Mar 24, 2005
Posts: 186
At first blush it appears you are still trying to use some sort of a Microsoft database driver to access MySQL. MySQL is NOT a Microsoft database.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3436
    
  47

MySQL is not Microsoft's database, but I believe MS provides ODBC driver for it.

In any case, it is a bad idea to use ODBC driver when a thin JDBC driver exists, and there certainly is a thin driver for MySQL. Google mysql thin driver for some links (I don't use MySQL and cannot recommend a concrete driver). Avoid ODBC drivers whenever possible, you'll be saved from the hassle of configuring DSN too.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

Martin Vajsar wrote:MySQL is not Microsoft's database, but I believe MS provides ODBC driver for it.

If you mean "MySQL" when you say "MS" then you're right. Because it's Oracle (the owner of MySQL) that provides the ODBC driver.

But I agree that the MySQL JDBC driver should be used instead of going through ODBC.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3436
    
  47

Rob Spoor wrote:If you mean "MySQL" when you say "MS" then you're right. Because it's Oracle (the owner of MySQL) that provides the ODBC driver.

Didn't know that.

I know MS provides lots of ODBC drivers (or provided on Windows XP, fortunately I got rid of all ODBC-ish connections some time ago and don't really know the situation in Windows 7). I had thought MySQL driver is perhaps included in the bunch.

I remember there were two ODBC drivers for Oracle - one from Microsoft, installed with Windows, and another from Oracle, installed with the Oracle client software. They "featured" different bugs, so it was possible to workaround certain issues by switching to the other one.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
 
Similar Threads
MySQL can't connect with my driver
File Dsn Problem?
Problem with JDBC in Windows 7
window 7 64bit using database problem
[Microsoft][ODBC Driver Manager] Invalid string or buffer length exception for 64 bit SQL Server