Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQLException

0 views
Skip to first unread message

John Luo

unread,
Dec 3, 2001, 12:10:29 AM12/3/01
to
Does anyone know what this SQLException mean?

I am using SQL 2000 JDBC driver connection to the pubs database of SQL 2000
from a class on my local machine, but I got the java.sql.SQLException as
following:

Connecting to
jdbc:microsoft:sqlserver://192.168.1.101:1433;DatabaseName=pubs
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver][SQLServer]Login
failed
for user 'sa'. Reason: Not associated with a trusted SQL Server connection.
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSLoginRequest.processReplyToken(Un
known Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown
Sour
ce)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown
Sou
rce)
at
com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown S
ource)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at javaservlets.db.SimpleQuery11.performQuery(SimpleQuery11.java:82)
at javaservlets.db.SimpleQuery11.main(SimpleQuery11.java:39)


It is saying that the reason for the exception is that "Not associated with
a trusted SQL Server connection", does any one know this mean? The IP
address is the static IP for my machine.

Thanks,

John

jl...@austin.rr.com


David Harbige

unread,
Dec 5, 2001, 7:56:16 AM12/5/01
to
There are two types of login to Microsoft's SQL server: 'normal' (or SQL
server) logins where you have to supply a username and password for each
connection, and 'trusted' (or 'Windows') logins that use the NT security
context of the process you are running to automatically map onto an SQL
login.

By default, SQL 2000 (and I think 7.0) only uses 'trusted' connections, and
the exception (in a not very obvious way) that there is no SQL login
associated with the security context your process is running in.

To solve your problem, if you wish to use the username and password method
of connecting, you need to configure SQL server to accept 'normal' logins.
From Enterprise Manager, right-click on your server and select 'Properties'.
In the 'Security' tab, make sure that 'SQL Server and Windows' is selected.
You will have to restart your server for the change to take effect.

If this doesn't work, then I don't know what the problem is.

Regards,

David Harbige

"John Luo" <jl...@austin.rr.com> wrote in message
news:#3sgZm7eBHA.2420@tkmsftngp07...

Steven Baranski

unread,
Dec 5, 2001, 4:54:02 PM12/5/01
to
You are correct:

My understanding is that there is a bug that prevents this from working
(still) locally. I think this is/was addressed in the recent release of
SP2. I haven't had a chance to download and install that, so good luck!

Regards,
Steven Baranski

"David Harbige" <dhar...@aconite.co.uk> wrote in message
news:ODATuuYfBHA.1396@tkmsftngp07...

Joseph Weinstein

unread,
Dec 5, 2001, 5:27:18 PM12/5/01
to Steven Baranski

Steven Baranski wrote:
>
> You are correct:
>
> My understanding is that there is a bug that prevents this from working
> (still) locally. I think this is/was addressed in the recent release of
> SP2.

Nope, I'm guessing not, and I believe it will never work because it
requires OS access that no type-4 driver will ever have.
Joe

0 new messages