Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / December 2007

Tip: Looking for answers? Try searching our database.

sqlserver JDBC driver problem.

Thread view: 
Matthew Shelton - 23 Nov 2007 00:25 GMT
Hi, all,

look, its a dead horse to beat!

I fixed my problem in the middle of writing this post.

I had spent days trying to fix the class path in netbeans. I'm using
sqlserver express 2005 on winXP with netbeans 5.5, with the Microsoft
JDBC type 4 driver.

I did the entire routine, sqljdbc folder in class path sqljdbc_auth.dll
copied, and still coming up with nothing.

So i tried eclipse, and found a way to add a containing folder to a
library, which I suppose made the .dll visible.

I'm liking eclipse a little better as an IDE, but for my own piece of
mind, how the f.ck do you get the classpath to work in netbeans?

I left with the "failure to load sqljdbc_auth.dll" error, thats when I
switched to eclipse and got it working.

Any words of wisdom would be helpful, thanks in advance, guys.

~MS
AL - 23 Nov 2007 04:41 GMT
> Hi, all,
>
[quoted text clipped - 21 lines]
>
> ~MS

I'm running a full blown version of SQL Server 2005 so I don't know if
it differs that much from the Express version, but, I copied the
sqljdbc.jar and sqljsbc_auth.dll into the following JAVA directories:

C:\Program Files\Java\jdk\jre\lib\ext
C:\Program Files\Java\jre\lib\ext

I may not have needed to copy the files into both \ext directories but
it was easy enough to do both and be done with it.

With the files residing in these directories I haven't had to mess with
classpath parameters and my netbeans 5.5 works just fine.

I hope this works for you and eases the frustration your choice of
language conveys...

AL
Lothar Kimmeringer - 23 Nov 2007 16:28 GMT
> I'm liking eclipse a little better as an IDE, but for my own piece of
> mind, how the f.ck do you get the classpath to work in netbeans?
>
> I left with the "failure to load sqljdbc_auth.dll" error, thats when I
> switched to eclipse and got it working.

The DLL must reside in a directory that is part of the PATH-
variable and not the classpath. Maybe Eclipse is adding the
classpath to the PATH-variable.

Putting the DLL inside %WINDIR%/system32 should work for all
IDEs but you have to cope with the DLLs agein when deploying.

Regards, Lothar
Signature

Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
              PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                questions!

Lew - 23 Nov 2007 16:55 GMT
>> I'm liking eclipse a little better as an IDE, but for my own piece of
>> mind, how the f.ck do you get the classpath to work in netbeans?
[quoted text clipped - 8 lines]
> Putting the DLL inside %WINDIR%/system32 should work for all
> IDEs but you have to cope with the DLLs agein when deploying.

I think it's a terrible idea to put application code in the Win system
directory.  It's one of my bugbears with Windows that everyone does that.

OTOH, everyone does that.  Just heaven help you if you ever have to to upgrade
Windows, or to re-install it, not that Windows is ever unstable enough that
you'd ever need to do that, ever.

Signature

Lew

Matthew Shelton - 24 Nov 2007 16:31 GMT
>>> I'm liking eclipse a little better as an IDE, but for my own piece of
>>> mind, how the f.ck do you get the classpath to work in netbeans?
[quoted text clipped - 15 lines]
> upgrade Windows, or to re-install it, not that Windows is ever unstable
> enough that you'd ever need to do that, ever.

Yet another reminder why *nix is a superior OS. a link to a directory
in the path would have been the only way to do it.

You never hear a windows guy talk about uptime ;)

The solution worked, thanks guys.

This leads me to another question, There are obvious issues with
deployment with this setup. Assume this app will be made available to a
few hundred users (employees).
So is there a way to create a static link a win32 DLL file and the JAR
file as if I wrote it myself? or is it any better to create a folder
with the files in it and add the path to the path variable upon
installation?

Let me know what you think, im curious about your opinions.

~MS
Sabine Dinis Blochberger - 26 Nov 2007 09:48 GMT
> > I'm liking eclipse a little better as an IDE, but for my own piece of
> > mind, how the f.ck do you get the classpath to work in netbeans?
[quoted text clipped - 10 lines]
>
> Regards, Lothar

You can keep the dlls in the same directory as the application jar file
(not the lib/ subdirectory).

This also works with "regular" windows applications, but it does look in
its own directory last, so if the dlls are also in system32, you might
have version problems.

I always "package" dlls to reside in the application directory. Haven't
had issues yet, but YMMV.
Signature

Sabine Dinis Blochberger

Op3racional
www.op3racional.eu

Donkey Hot - 24 Dec 2007 00:30 GMT
> I had spent days trying to fix the class path in netbeans. I'm using
> sqlserver express 2005 on winXP with netbeans 5.5, with the Microsoft
> JDBC type 4 driver.
>
> I did the entire routine, sqljdbc folder in class path sqljdbc_auth.dll
> copied, and still coming up with nothing.

Strange type 4 driver, if it needs a dll... Type 4 should be pure java.

One good jdbc type 4 driver is open source jTDS. It's said to be fastest
jdbc driver for SQLServer, and worked fine for me, also in Netbeans/tomcat.

One jar is all it is. http://jtds.sourceforge.net/
Matthew Shelton - 28 Dec 2007 15:56 GMT
>> I had spent days trying to fix the class path in netbeans. I'm using
>> sqlserver express 2005 on winXP with netbeans 5.5, with the Microsoft
[quoted text clipped - 9 lines]
>
> One jar is all it is. http://jtds.sourceforge.net/

Thanks for the tip, I was a little concerned with deployment, having to
ship a .dll that isnt my own code, at least I can make a static link
with this, considering there will be a Swing interface as well as a
website with the same functionality.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.