aspose file tools
The moose likes JDBC and the fly likes data connection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "data connection problem" Watch "data connection problem" New topic
Author

data connection problem

Pat Johnson
Greenhorn

Joined: Feb 16, 2011
Posts: 1
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
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: data connection problem
 
Similar Threads
SQL Server 2000 JDBC Driver Error
Hi,I have a problem in database connection
SQL Server 2008r2 Connection Failed
SQL Server Connection question
SQL Server DB connection