• Post Reply Bookmark Topic Watch Topic
  • New Topic

data connection problem

Pat Johnson
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before you say it, I've searched all over for a solution to my problem and I cannot get it resolved.

Platform: Windows 7 64 bit
Problem: Cannot connect to sqlserver database
Knowledge Level: Novice

Background of problem:

I'm writing an application that I want to connected to a sql server data source. I've created a DSN called "pawnDataSource" that uses Windows Authentication and a named instance, but I cannot connect to it. I've read that you need using sql server authentication should solve some problems, but cannot get this type of connection to work (although these are created in the named instance of sqlserver). Since I was getting errors with that connection string in my code, I decided to just use the named instance sqlserver (in this case TOUWORKSTATION) instead of a DSN.

Admittedly, I am relatively new to Java programming (and programming in general), so please go easy on me.

I am now getting the following error when I get to the data access part of my program:

java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.

Here is the code causing the error:

super class that contains the connection string, etc.

subclass that extends the superclass:

Any help or suggestions would be greatly appreciated and thanks in advance!

Rob Spoor
Posts: 20837
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Moving to the JDBC forum, since that's where we handle database problems.

2) You are providing an empty user name and password. Apparently that makes the driver try to use your Windows login, but for that it needs a DLL (sqljdbc_auth.dll for the SQL Server 2005 driver; it's inside the sqljdbc executable from Microsoft's website) to be on Java's library path. Either do that, or get rid of UN_PW and supply the user name and password in the call to DriverManager.getConnectionString.
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!