MS SQL Login Failure

I just started trying put together a Servoy application based upon a real project after working through some of the tutorials. I’m having trouble getting the Servoy JDBC to connect to a local MS SQL 2008 R2 instance on my development PC.

Username: sa
Password: *******
URL: jdbc:sqlserver://:49363;DatabaseName=HDA_II;SelectMethod=cursor
Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver

The port is open and I get an authentication error: Login failed for user ‘sa’.

I’ve tried changing the password to various different things with no success. I’ve used my own username in Windows with no success.
I’ve checked the MS SQL configurations for connections, etc. Looks good.

Any suggestions to what might be causing my issue? It seems like it could be something inside MS SQL that isn’t configured properly.

Thanks!

I was having a similar problem. Perhaps this may help…

After I checked to ensure TCP/IP is enabled from the SQLServer Configuration Manager->SQL Server Network Configuration->Protocols option, and after 2 days of trial and error the connection string below worked for me.

jdbc:sqlserver://;DatabaseName=myDatabaseName;SelectMethod=cursor

Note: No server name (defaults to local default instance port 1433), I only had one instance of sqlexpress loaded.

Hope this helps

Larry Long

Larry,

I’ve attempted to duplicate your setup using SQLEXPRESS vs my own instance and I still get the same Login Failed response. TCP/IP is enabled and it is obviously talking. I get a different error when it isn’t communicating at all.
I am working in Win7 64 bit. I’m wondering if there’s something quirky with that. Otherwise, I’m interested in your SQL Server Network Configuration settings under TCP/IP, though I don’t think I’d be getting to the authentication at all if this configuration were wrong.

Thank you for your time!
Jeremy

Drop me an email (LALONG1@charter.net) and I will send you screen shots of my setup

Larry

One other thing, is your sql setup for windows or sql authentication?

Also, check to see that the sa user is enabled. I think that it’s disabled by default.

Good job, Larry, you got me double checking my configs.

I couldn’t get the SQLEXPRESS instance to enable ‘sa’ no matter what I tried so far. But, that wasn’t my trouble with my own SQL instance. On that one I only had Windows Authentication enabled and not mixed. Two different issues for each instance and I kept missing the settings. I had a feeling that was my problem somewhere in there. I still can’t get my Windows login to open it up but I setup a SQL user with DBO privileges and it appears to be working.

Any insights on the Windows authentication problem are still welcome. I’ve tried prefacing my username with the domain name to no avail. <Windows username>

Thanks for your help and the sanity check.
Jeremy

Glad to help out. Unless you’ve got a complex password set up for the sa user you need to turn off the “Enforce security policy” option. It’s on same page where you set the password. I’m guessing that this is your problem on you local machine

If you don’t want to select mixed mode, did you add a sql user with your windows login?

I setup a SQL login not tied to AD. That’s good to know about the password policy.

When I get some more time, I’ll play around with different login scenarios.

Thanks,
Jeremy