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
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...
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...
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