aspose file tools*
The moose likes JDBC and the fly likes Faint, failure to connect ms sqlserver with jtds Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Faint, failure to connect ms sqlserver with jtds" Watch "Faint, failure to connect ms sqlserver with jtds" New topic
Author

Faint, failure to connect ms sqlserver with jtds

Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Aaaaah......

Error:

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

I saw someone said that this error is caused by some errors in install sqlserver...But,I delete it and install again,then,fail again.

Now I want to use the jdbc driver providered by ms.

But,my God,the download page cannot open.....

Faint!
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Can someone give me a link of a sqlserver jdbc driver?
Thanks.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
http://faq.javaranch.com/view?GeneralJdbcQuestions
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
a o~

That is a link to microsoft...
And ,cann't open the download page...

But,thank you all the same.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by Zhang Alan:
a o~

That is a link to microsoft...
And ,cann't open the download page...

But,thank you all the same.


And why don't you use the jtds driver then... since it works.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by Maximilian Stocker:


And why don't you use the jtds driver then... since it works.


Also the MS link works fine for me. I can get to the page and download the setup file so if it doesn't work for you something is wrong with your internet connection or browser.
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Originally posted by Maximilian Stocker:


And why don't you use the jtds driver then... since it works.


I have already had a jtds driver.

But I got a error,which I said in my topic.

So I want to change to ms sqlserver driver.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by Zhang Alan:


I have already had a jtds driver.

But I got a error,which I said in my topic.

So I want to change to ms sqlserver driver.


The JTDS driver is FAR less buggy than the ms one. I have never seen that error before with JTDS and since there are no native components to the JTDS driver I would conclude that the error you posted has nothing to do with the driver. That error is something else wrong.

Please post the top part of your stack trace and the offending code. There is another bug in your program/setup which you currently have misidentified.
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Originally posted by Maximilian Stocker:


Also the MS link works fine for me. I can get to the page and download the setup file so if it doesn't work for you something is wrong with your internet connection or browser.


May be.

The protocal of the page is https.May be this is the point.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by Maximilian Stocker:


The JTDS driver is FAR less buggy than the ms one. I have never seen that error before with JTDS and since there are no native components to the JTDS driver I would conclude that the error you posted has nothing to do with the driver. That error is something else wrong.

Please post the top part of your stack trace and the offending code. There is another bug in your program/setup which you currently have misidentified.


Okay I did more research and found the error. You are attempting to use Windows authentication. Use SQL Server authentication instead.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by Zhang Alan:


May be.

The protocal of the page is https.May be this is the point.


I really think you should just fix your problem and keep the jtds driver.
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Originally posted by Maximilian Stocker:


The JTDS driver is FAR less buggy than the ms one. I have never seen that error before with JTDS and since there are no native components to the JTDS driver I would conclude that the error you posted has nothing to do with the driver. That error is something else wrong.

Please post the top part of your stack trace and the offending code. There is another bug in your program/setup which you currently have misidentified.


You are right. I did a small test of useing jtds to connect sqlserver,and successed.

So the error is not caused by the jtds.

But I set up a database in mysql and connected it with mysqldriver,and successed.

So I want try to use ms sqlserver driver instead of jtds. Just try.

This is the track trace following.

java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Ch
eck the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:611)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java
:331)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java
:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at bin.Dbo.<init>(Dbo.java:78)
at bin.FtpSearch.main(FtpSearch.java:30)
Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Chec
k the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1894)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:584)
... 7 more


And,I have gotten a ms sqlserver driver from microsoft.Just not the last version.

And,now I must go to bed..The time of my area is 0:17 am.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
When you come back see my previous post about SQL server authentication vs Windows authentication.
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Originally posted by Maximilian Stocker:


Okay I did more research and found the error. You are attempting to use Windows authentication. Use SQL Server authentication instead.


I am useing the SQL Server authentication. I have read the topic of this problem which may be you read right now. And he(she) change to use ms driver at last. So.....

And I have heard that jtds is better than the ms driver.So at first I chose jtds.but..

And I cannot find the error in my program. So ...

Really,I must go to bed beacuse is too late for me and I have a lesson this morning.

Thank you and bye.
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Originally posted by Maximilian Stocker:
When you come back see my previous post about SQL server authentication vs Windows authentication.


I have to applications used jtds.

One of them is a java web application.And it works well.

Another is a console application. This one cannot work.

If the error is caused by the difference of these two authentications, I can't have a application can work well because the database of these two application is same.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Another is a console application. This one cannot work.

"console application"? - not sure what you mean by that. Do you just mean a stand alone Java application?


If the error is caused by the difference of these two authentications, I can't have a application can work well because the database of these two application is same

JDBC will only work when your SQL Server instance uses "SQL Server and Windows" authentication. You cannot connect to a SQL Server instance via JDBC (regardless of which driver you use) with "Windows only" authentication.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Alin Sinpalean
Greenhorn

Joined: Jun 02, 2005
Posts: 6
JDBC will only work when your SQL Server instance uses "SQL Server and Windows" authentication. You cannot connect to a SQL Server instance via JDBC (regardless of which driver you use) with "Windows only" authentication.


That's wrong. jTDS is able to connect to SQL Server using Windows Authentication, either by using a native DLL or if the user specifies a domain property in the url, in which case the user and password properties are used as Windows credentials.

I am useing the SQL Server authentication. I have read the topic of this problem which may be you read right now. And he(she) change to use ms driver at last. So.....


No, you're not. You're not specifying a user name and password, neither in your URL nor in the getConnection() call. That's why jTDS is trying to use the native DLL to authenticate: by not specifying a user name and password you're asking it to use the current Windows user's credentials to log in.

Alin,
The jTDS Project.
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
"console application"? - not sure what you mean by that. Do you just mean a stand alone Java application?




Yes.


No, you're not. You're not specifying a user name and password, neither in your URL nor in the getConnection() call. That's why jTDS is trying to use the native DLL to authenticate: by not specifying a user name and password you're asking it to use the current Windows user's credentials to log in.



I've know where I am wrong. It same to be this:

I wrote this when I use mysql as my database.

Class.forName(driverClass).newInstance();
String url = jdbcURL ;
url += "?user=" + user;
url += "&password=" + password;

conn= DriverManager.getConnection(url);

And,now I'm using ms sqlserver. But I didn't edit this file. So,I got the error.

Now I edit the program:

Class.forName(driverClass).newInstance();
String url = jdbcURL ;

conn= DriverManager.getConnection(url,user,password);

And,this time it works well!

By the way,I find that,when I use the driver of ms,my program run very,very slowly.

Now I change back to jtds,and this time it works well and much faster than it works on ms driver.


Hehe,so,use the jtds instead of ms jdbc driver!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


That's wrong. jTDS is able to connect to SQL Server using Windows Authentication, either by using a native DLL or if the user specifies a domain property in the url, in which case the user and password properties are used as Windows credentials.

Ah yes. Just re-read the FAQs. Thanks for the correction.
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
A question has nothing to do with DB.

Is there any board we can talk about some thing else in this forum?(We call it a water board)

For example,"Where are you from ?"
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30555
    
152

Zhang,
The third to last forum is called "Meaningless Drivel." That's the place for all non-Java related discussion.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Zhang Alan
Greenhorn

Joined: Nov 09, 2005
Posts: 22
Aa yes.

I found it.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Faint, failure to connect ms sqlserver with jtds