• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Vashko
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic