java.sql.SQLException for DriverManager.getConnection(url)

J

jrefactors

The Java program connects to MS-SQL with Windows authentication, and
there is no username and password.

In the code, I do the following and it has java.sql.SQLException error.

String url =
"jdbc:microsoft:sqlserver://servername;DatabaseName=databasename";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection con = DriverManager.getConnection(url);


any ideas? please advise.

thanks!!
 
B

Bob Withers

The Java program connects to MS-SQL with Windows authentication, and
there is no username and password.

In the code, I do the following and it has java.sql.SQLException error.

<snip code>

Does the SQLException have a message associated with it?

Bob
 
J

jrefactors

Here's the exception:

[6/2/05 14:58:46:150 PDT] 68183d5e SystemErr R
java.sql.SQLException: [Microsoft][SQLServer JDBC
Driver][SQLServer]Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.
 
M

Manish

Hi,
I got this info..check out...

These are common error messages that may occur when you try to connect
to your SQL server:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]Login failed for user 'user'. Reason: Not associated
with a trusted SQL Server connection.
This error message occurs if the SQL Server 2000 authentication mode is
set to Windows Authentication mode. The Microsoft SQL Server 2000
driver for JDBC does not support connecting by using Windows NT
authentication. You must set the authentication mode of your SQL Server
to Mixed mode, which permits both Windows Authentication and SQL Server
Authentication.

link..
http://support.microsoft.com/default.aspx?scid=kb;en-us;313100
Manish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top