Hi
I have a
java application connecting to a MS SQL Server database. I set up an ODBC connection in "Windows ODBC Data Source Administrator" using its SQL Server driver. I have no problems connecting and all SQL executes fine.
I use the following driverManager: "sun.jdbc.odbc.JdbcOdbcDriver"
and connectionString: "jdbc

dbc

atasourcename"
However, it only seems to work if I define the username & password with the connection
string. I do not want to define the password in the java application or any config file but in the ODBC data source.
The Windows ODBC Data Source Administrator (SQL Server driver) allows you to select "Connect to SQL Server to obtain default settings for the additional configuration options". It allows one to enter a 'Login ID' & 'Password'. Then one can proceed and
test the connection.
I define the LoginId & Password and test the connection successfully. But when I access the database through the Java application it fails with the following error:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
To me it appears that the ODBC data source's Userid & password is not being applied when the connection is created.
Is there anyway one can configure this so that the userid & password does not have to be defined with the connection string in the java application when the connection is created?