1

I am trying to connect to SQL Server 2008 on another box with integrated authentication. My environment includes 64bit Java 7, 64 bit Eclipse, and 64-bit Windows 7. I used JDBC driver provided by Microsoft. Everything works fine with 32-bit Java. However, with 64-bit Java, I got the following:

"WARNING: Failed to load the sqljdbc_auth.dll cause : C:\Program Files (x86)\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\auth\x86\sqljdbc_auth.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform ..."

I found http://msdn.microsoft.com/en-us/library/ms378428.aspx, but none of the suggestions there seems to work. Specifically,

  • I copied "sqljdbc_4.0\enu\auth\x64\sqljdbc_auth.dll" to "sqljdbc_4.0\enu", an"C:\Windows", and "C:\Windows\System32". Got the same error.

  • I set " -Djava.library.path=C:\Program Files (x86)\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\auth\x64" in the VM arguments of Eclipse, then I got:

"Error: Could not find or load main class Files"

Any idea? Not sure why it is using 32-bit sqljdbc_auth.dll? AFAIK, the sql server 2008 is of 64 bit.

Many thanks!

user2159018
  • 39
  • 1
  • 4

1 Answers1

1

The x86 is in the system path of windows and probably being picked up before the x64 one.

Search for the x86 dll and delete it and put the x64 dll in there.

When you set the VM argument make sure you append it and not replace it. The Error: Could not find or load main class Files is probably occurring due to a classpath issue.

Thihara
  • 7,031
  • 2
  • 29
  • 56
  • Thanks Thihara. The problem was solved by indicating the classpath. See http://stackoverflow.com/questions/957700/how-to-set-the-java-library-path-from-eclipse for details. – user2159018 Apr 04 '13 at 15:30