File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
pravin gajbhiye
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20399
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic