Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

HELP connecting JSP app to MS SQL using Windows Authentication

Thread view: 
Harperator - 22 Feb 2007 19:27 GMT
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:odbc:old_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:odbc:new_way","user_name","pass_word");
("jdbc:odbc:new_way","","");
("jdbc:odbc: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

dharper@research.umass.edu
Arne Vajhøj - 25 Feb 2007 19:18 GMT
> 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
[quoted text clipped - 22 lines]
> [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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.