Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System.getProperty() rejects logon

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have been running my app by connecting to a MSSQL database using a log on of "Master" and no password. It has been working great.
Now I have created a userID in SQL that is my NT logon (jsohl). I want to use this to log in to the database. I can use WindowsNT authentication in Query Analyzer and it works.
So, in my app, I replaced "master" with System.getProperty("user.name")
and it keeps rejecting the log on. Why??
(In SQL server, I have my logon defined to used WindowsNT authentication. It works with SQL server authentication?)
Here's my code:

What am I doing wrong?
Thanks for any help!
[ November 25, 2002: Message edited by: Jennifer Sohl ]
 
Tina Coleman
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a System.out.println on the property to verify that you're sending your name. If your app is actually operating within a web server, then the username used will be different, I believe. Also, you're not sending through a password. . .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic