HELP connecting JSP app to MS SQL using Windows Authentication

H

Harperator

Hi-
I wrote an app years ago using jsp, and life has been good, it just
hummed along quietly passing the password and username in the
connection string ex:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:eek:dbc:eek:ld_way","user_name","pass_word");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM blah blah blah....");

now we have a new database that needs windows authentication.

I built a new ODBC data source using the new server and windows
authentication and it connects fine. (lets call it new_way)

QUESTION: How do I code the new ODBC source?

("jdbc:eek:dbc:new_way","user_name","pass_word");
("jdbc:eek:dbc:new_way","","");
("jdbc:eek:dbc:new_way");

all above give me the following error:

javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]
[SQL Server]Login failed for user '(null)'. Reason: Not associated
with a trusted SQL Server connection.


HELP!

Thanks in advance

(e-mail address removed)
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Harperator said:
I wrote an app years ago using jsp, and life has been good, it just
hummed along quietly passing the password and username in the
connection string ex:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:eek:dbc:eek:ld_way","user_name","pass_word");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM blah blah blah....");

now we have a new database that needs windows authentication.

I built a new ODBC data source using the new server and windows
authentication and it connects fine. (lets call it new_way)

QUESTION: How do I code the new ODBC source?

("jdbc:eek:dbc:new_way","user_name","pass_word");
("jdbc:eek:dbc:new_way","","");
("jdbc:eek:dbc:new_way");

all above give me the following error:

javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]
[SQL Server]Login failed for user '(null)'. Reason: Not associated
with a trusted SQL Server connection.

http://support.microsoft.com/kb/313100

Quote:

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

Arne
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top