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 / Databases / February 2007

Tip: Looking for answers? Try searching our database.

JDBC connection to SQL Server 2005 with domain user

Thread view: 
Rupert Woodman - 01 Feb 2007 19:50 GMT
I can connect to a SQL Server 2005 database using the Microsoft JDBC driver,
using either a SQL Server user, or using the credentials of the user
currently logged in without any problems.
However, I want to login using a domain user, different to the user
currently logged in to the machine running the application.

I've tried using both URL connection strings and a Properties object, but I
can't get it to work.  As soon as I specify "integratedSecurity=true", it
uses the credentials of the current user.

I'm sure it must be possible,  but I couldn't find anything on Google.
Could someone give me a clue (or an example would be even better!) please?

Many thanks
joeNOSPAM@BEA.com - 01 Feb 2007 22:51 GMT
On Feb 1, 11:50 am, "Rupert Woodman" <rupert.wood...@microfocus.com>
wrote:
> I can connect to a SQL Server 2005 database using the Microsoft JDBC driver,
> using either a SQL Server user, or using the credentials of the user
[quoted text clipped - 10 lines]
>
> Many thanks

You're not going to make that work. You have two choices:

1 - set an explicit user and password string in the properties for the
driver to send to the DBMS. That will work anywhere for any OS user
as long as the DBMS user/password are valid.

2 - Use the driver's integrated security, which automatically absorbs
the *current OS user's* identity to verify with the DBMS at runtime.

There is no way to tell the driver/JVM/Windows to automatically act
as if some other person is running your Java program.

Joe Weinstein at BEA Systems
Rupert Woodman - 02 Feb 2007 13:17 GMT
Thanks Joe.
You're saying that validating against a domain user is impossible (even when
the username and password are known) - it either has to be a non-domain user
(i.e. SQL Server authentication), or you use integratedSecutory=true, and it
then uses the credentials of the user currently logged in?
It seems a little odd behaviour to me.  We have a domain account which is
used for our build process, so has limited permissions.  The application I'm
writing can be run by anyone on their machines, to do a particular task, and
then exit the app.  I really don't want to have to create SQL Server
accounts on each SQL Server instance just for this app.  Seems crazy to me.

Thanks for your input

rgds

Rupert

> On Feb 1, 11:50 am, "Rupert Woodman" <rupert.wood...@microfocus.com>
> wrote:
[quoted text clipped - 29 lines]
>
> Joe Weinstein at BEA Systems
joeNOSPAM@BEA.com - 02 Feb 2007 17:18 GMT
Hi. That's as I understand it, but you should definitely follow up
with a post to the microsoft.public.sqlserver.jdbcdriver newsgroup
at msnews.microsoft.com. They will be the authorities, and may
have different/better news.

Joe Weinstein at BEA Systems
Rupert Woodman - 02 Feb 2007 18:39 GMT
Thanks for your input, and thanks for the info on the newsgroup - I'll do
that.  When I've found out a definitive answer, I'll post it back here for
reference.

Thanks Joe.

rgds

> Hi. That's as I understand it, but you should definitely follow up
> with a post to the microsoft.public.sqlserver.jdbcdriver newsgroup
> at msnews.microsoft.com. They will be the authorities, and may
> have different/better news.
>
> Joe Weinstein at BEA Systems
Rupert Woodman - 05 Feb 2007 20:42 GMT
Well, no response from the Microsoft forum.
However, I have found that the jTDS driver (http://jtds.sourceforge.net/)
does allow for the domain, with just the addition of a property, so that's
what I'm using.  Works like a good 'un!

thanks chaps (Joe esp)

> Thanks for your input, and thanks for the info on the newsgroup - I'll do
> that.  When I've found out a definitive answer, I'll post it back here for
[quoted text clipped - 10 lines]
>>
>> Joe Weinstein at BEA Systems
Rupert Woodman - 07 Feb 2007 15:21 GMT
This is the reply I got from Microsoft about it (bottom line: I can't do
what I want with the Microsoft driver):

> Hello Rupert,
>
[quoted text clipped - 10 lines]
> is
> what you would need to use to implement this.

rgds

Rupert

> Well, no response from the Microsoft forum.
> However, I have found that the jTDS driver (http://jtds.sourceforge.net/)
[quoted text clipped - 17 lines]
>>>
>>> Joe Weinstein at BEA Systems


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.