Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:29:41+00:00 2026-06-11T15:29:41+00:00

Let me give some background before I ask my question. I’m at a shop

  • 0

Let me give some background before I ask my question. I’m at a shop that primarily runs Windows. We have several batch applications running on Windows Servers (mostly 2003). Most of these batch applications are written in C# and C++; however we have a handful of applications that are written in Java.

The batch Java applications are connecting to a SQL Server 2005 database using JDBC. Please note we are not using an application server.

Currently we store database connection information (database, username, & password) in the Windows Registry.

Unfortunately these really unfriendly auditors (bad attempt at humor) are not happy with us over the decision to store database connection information in the Windows registry.
We are now updating our batch applications to connect to SQL Server using Windows Authentatication.

Using Windows Authentatication for C# and C++ applications is not a problem; however I’m stuck on the direction to take for the Java applications.

Can anyone advise if it is possible to use Windows Authentatication to connect to a SQL Server 2005 database from a Java batch application running on a Windows server? Again we are not using an application server.

If this is possible what are your recommended approaches?

I have a strategy to simply encrypt the password which will make the auditors happy, however I would prefer to have all of my batch applications connect to SQL Server via Windows Authentatication.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:29:43+00:00Added an answer on June 11, 2026 at 3:29 pm

    You can connect to SQL Server from Java programs using windows authentication as follows:

    1. Create a windows account for the application that would be used to run your programs. This account’s credentials will be used to connect to the server.
    2. Get Microsoft JDBC Driver for SQL Server from here.
    3. Configure the JDBC URL as follows:

      jdbc:sqlserver://<hostname>;databaseName=<DBName>;integratedSecurity=true
      
    4. Configure the launcher that run the Java programs from command line to include the following JVM parameter:

      -Djava.library.path="<jdbc driver dll location>"
      

      where the location is the directory where the JDBC driver downloaded earlier is installed or extracted. It was C:\Program Files\sqljdbc_4.0.2206.100_enu\sqljdbc_4.0\enu\auth\x64 in my case. As Luke Woodward mentioned in the comments, the dll should be picked based on the JVM used for running these programs.

    With the above configuration, the connection established to SQL Server would use the Windows Authentication Credentials of the domain user running the java program/process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Might be complicated, so let me give you some background: I have a spreadsheet
Ok, the question might not be crystal clear. Let me give some details: Let's
(Let me give you some context) I am currently designing an application that is
-Let me give some background first- My assignment is to take a given senario
Let me give you some background on my scenario. I got a multi language
Ok, let's give you an example (original question below). I have made a package
I've created a bunch of projects in Eclipse 3.7.2. Let's give some of them
Let me explain best with an example. Say you have node class that can
Let's say that I have a SQLite database that I create in a separate
I know my question is too inaccurate to answer but let me give you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.