November 14, 2011 at 12:52 pm
I have identical jdbc connections coming from two different window servers into the same sql server 2008 database. I'm not specifying the database name in the connection string, one is connecting to the default database like I think it should, the other is connecting to "MASTER"? I'm stumped as to how this can happen, any help to point me in the right direction would be much appreciated.
Also if I add the databasename into the connection string it still connects to "MASTER" ?
TIA
November 15, 2011 at 1:32 am
A possible reason could be SQL Server Login's Default Database setting. If you don't specify any database name in connection string it will jump to Login’s default. Connection's DB Name should override it but I am not sure. Use the following and change the default DB Name for the Login. Let us know if it works.
ALTER LOGIN login_name
{
<status_option>
| WITH <set_option> [ ,... ]
| <cryptographic_credential_option>
}
<status_option> ::=
ENABLE | DISABLE
<set_option> ::=
PASSWORD = 'password' | hashed_password HASHED
[
OLD_PASSWORD = 'oldpassword'
| <password_option> [<password_option> ]
]
| DEFAULT_DATABASE = database
| DEFAULT_LANGUAGE = language
| NAME = login_name
| CHECK_POLICY = { ON | OFF }
| CHECK_EXPIRATION = { ON | OFF }
| CREDENTIAL = credential_name
| NO CREDENTIAL
<password_option> ::=
MUST_CHANGE | UNLOCK
<cryptographic_credentials_option> ::=
ADD CREDENTIAL credential_name
| DROP CREDENTIAL credential_name
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply