Showing posts with label password. Show all posts
Showing posts with label password. Show all posts

Wednesday, March 7, 2012

Cannot connect w/ Java app but can connect w/ .Net app - SQL Server Express 2005

I'm having a problem connecting with a Java application but I CAN connect using my .Net application - the user name and password are the same for both (using the same database on SQL Server Express 2005).

The error I get is: "com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "CORNERS" requested by the login. The login failed." An interesing note - I get the same message if the database is not running.

SQL Server Express 2005 is installed in mixed mode.

Here is my connection string in the .Net appplication: <add key="connectString" value="Server=(local);UID=sa;PWD=myPasswd;Database=CORNERS" />.

These are my values in my Java app web.xml -

<init-param>
<param-name>DBDriver</param-name>
<param-value>com.microsoft.sqlserver.jdbc.SQLServerDriver</param-value>
</init-param>
<init-param>

<param-name>DBURL</param-name> <param-value>jdbc:sqlserver://localhost\sqlexpress:1055;databaseName=CORNERS</param-value>

</init-param>
<init-param>
<param-name>DBUser</param-name>
<param-value>sa</param-value>
</init-param>
<init-param>
<param-name>DBPwd</param-name>
<param-value>myPasswd</param-value>
</init-param>.

And yes, the port is 1055 - I checked to find it.

I am using Microsoft SQL Server 2005 JDBC Driver 1.0 (sqljdbc_1.0.809.102).

Does anyone have any idea what is wrong so that the login fails in the Java application but works in the .Net application?

Mostlikely, you have a syntax error in your connection string.

jdbc:sqlserver://localhost\sqlexpress:1055;databaseName=CORNERS

please refer to http://msdn2.microsoft.com/en-us/library/ms378428.aspx

you can try

jdbc:sqlserver://localhost:1055;databaseName=CORNERS,

|||I tried your suggestion and it does not work. I get the same error. I tried many different variations of the connection string and none of them have worked.

I think it is important to note that I get this error even if the database is NOT running.

This leads me to believe it's a problem with the driver. I have the sqljdbc.jar located in my Tomcat\common\lib directory. Is this incorrect?|||Can you get a trace with FINEST level turned on?|||How do I turn the trace on? And to the finest level? And will this make a difference considering that I get the same message whether or not the database is actually running?|||

I'm having a similar problem. However I am using context.xml to define the connection pool as:

<Resource name="jdbc/SqlServerLocal"
auth="Container"
type="javax.sql.DataSource"
username="PortalUser"
password="********"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://servername\\SQLEXPRESS:1433"
maxActive="10"
maxIdle="4"
maxWait="100" />

and this works on my Windows development machine... but when I ftp the *.war file to the Linux server, I get the following message:

Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'

I put the 'sqljdbc.jar' file in the /common/lib path for both installations.

|||

Adisciullo,

Please refer to the following site for information regarding turning tracing on:

http://msdn2.microsoft.com/en-us/library/ms378517.aspx

Please post the results so we can further diagnose this.

Additionally, does this problem also reproduce with the v1.1 driver. You can find it at: http://www.microsoft.com/downloads/details.aspx?FamilyId=6D483869-816A-44CB-9787-A866235EFC7C&displaylang=en

Thanks,

Jaaved Mohammed

Tuesday, February 14, 2012

Cannot connect to Query Analyzer

Just a few days ago, we changed the password on our server. After that, I
noticed that I could not open Query Analyzer from within Enterprise Manager.
I can open Query Analyzer from the start menu and login that way, but can
someone help in where to look to make it be able to open from with in
Enterprise Manager again. Also, I have a local SQL Server on my laptop and
when I tried to change the password to it, through the edit registration
section, I could not. Any thoughts on what where to look, or what I am
supposed to do, to be able to change the password on my local sql server?And what happens if while you are in Enterprise Manager, you
go to the menu to Tools and then select Query Analyzer? What
doesn't work? Does Query Analyzer not show up in the menu or
are you getting an error? If it's an error, what is the
exact error and error number?
To change the password for the service account from
Enterprise Manager, select the server, right click and
select Properties. Click on the Security tab. You can change
the password or account used for the service from this
screen.
-Sue
On Fri, 11 Aug 2006 05:32:02 -0700, Mike Collins
<MikeCollins@.discussions.microsoft.com> wrote:

>Just a few days ago, we changed the password on our server. After that, I
>noticed that I could not open Query Analyzer from within Enterprise Manager
.
>I can open Query Analyzer from the start menu and login that way, but can
>someone help in where to look to make it be able to open from with in
>Enterprise Manager again. Also, I have a local SQL Server on my laptop and
>when I tried to change the password to it, through the edit registration
>section, I could not. Any thoughts on what where to look, or what I am
>supposed to do, to be able to change the password on my local sql server?|||When I go to tools and select query analyzer, I get an hour glass cursor for
a second, or two, and then nothing.
I check the security tab and if you are talking about the startup service
account section, system account is currentlly selected, so I do not have the
option to type in an account and password. Should I be using a certain
account?
Thanks
"Sue Hoegemeier" wrote:

> And what happens if while you are in Enterprise Manager, you
> go to the menu to Tools and then select Query Analyzer? What
> doesn't work? Does Query Analyzer not show up in the menu or
> are you getting an error? If it's an error, what is the
> exact error and error number?
> To change the password for the service account from
> Enterprise Manager, select the server, right click and
> select Properties. Click on the Security tab. You can change
> the password or account used for the service from this
> screen.
> -Sue
> On Fri, 11 Aug 2006 05:32:02 -0700, Mike Collins
> <MikeCollins@.discussions.microsoft.com> wrote:
>
>|||A few things to check on the issue with Query Analyzer:
First make sure you don't have tracing turned on. I don't
think this is your issue as you can open QA from the menu
but you would want to check to make sure. Open the Data
Sources (ODBC) tool from Administrative Tools. Go to the
tracing tab and make sure all tracing is turned off - the
buttons would display "Start <tool name> Tracing" if it's
turned off.
Try replacing the MMC app for SQL Server from the original
media. Find the file on your PC named SQL Server Enterprise
Manager.MSC. Rename it and replace it in the same location
with the original MSC file of the same name from the
original installation media.
In terms of the startup account, you wouldn't change the
password if it's running under a system account. Passwords
for those are managed by the operating system. It's
generally a better idea to run SQL Server under domain
accounts rather than system accounts. If your local SQL
Server doesn't need access to network resources in your
domain, you can create a local account on your PC and just
use that to run SQL Server. You want to change services
accounts from that security tab you saw in Enterprise
Manager. When you change the service accounts through
Enterprise Manager, the security and permissions necessary
on your PC for the service account would automatically be
handled, properly set when using Enterprise Manager.
-Sue
On Fri, 11 Aug 2006 14:03:02 -0700, Mike Collins
<MikeCollins@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>When I go to tools and select query analyzer, I get an hour glass cursor fo
r
>a second, or two, and then nothing.
>I check the security tab and if you are talking about the startup service
>account section, system account is currentlly selected, so I do not have th
e
>option to type in an account and password. Should I be using a certain
>account?
>Thanks
>"Sue Hoegemeier" wrote:
>|||Ok...I tried what you suggested with no luck. I'm thinking of maybe
reinstalling SQL Server.
For Query Analyzer, I tried replacing the file as you suggested but had the
same results (Enterprise Manager starts up fine, but still cannot start QA
from within Enterprise Manager).
Changing the password. I created an account on my laptop and changed SQL
Server from the system account to a local one and got the following message:
"Unable to detect the status of Full Text Search service or unable to start
the service. Continuing to change the account might affect Full Text Search
service later. Would you like to continue?". I wasn't sure what to do from
there, so I cancelled.
Any suggestions?
"Sue Hoegemeier" wrote:

> A few things to check on the issue with Query Analyzer:
> First make sure you don't have tracing turned on. I don't
> think this is your issue as you can open QA from the menu
> but you would want to check to make sure. Open the Data
> Sources (ODBC) tool from Administrative Tools. Go to the
> tracing tab and make sure all tracing is turned off - the
> buttons would display "Start <tool name> Tracing" if it's
> turned off.
> Try replacing the MMC app for SQL Server from the original
> media. Find the file on your PC named SQL Server Enterprise
> Manager.MSC. Rename it and replace it in the same location
> with the original MSC file of the same name from the
> original installation media.
> In terms of the startup account, you wouldn't change the
> password if it's running under a system account. Passwords
> for those are managed by the operating system. It's
> generally a better idea to run SQL Server under domain
> accounts rather than system accounts. If your local SQL
> Server doesn't need access to network resources in your
> domain, you can create a local account on your PC and just
> use that to run SQL Server. You want to change services
> accounts from that security tab you saw in Enterprise
> Manager. When you change the service accounts through
> Enterprise Manager, the security and permissions necessary
> on your PC for the service account would automatically be
> handled, properly set when using Enterprise Manager.
> -Sue
> On Fri, 11 Aug 2006 14:03:02 -0700, Mike Collins
> <MikeCollins@.discussions.microsoft.com> wrote:
>
>|||On the Query Analyzer issue, try reinstalling the client
tools. If that still doesn't work, I have no idea how it
broke. Check that isqlw.exe has not been moved from the
default installation location, make sure the tools directory
is in your environment path, make sure you can access Query
Analyzer by typing isqlw from the run command, etc. But for
all of those issues, you should be getting a file not found
error. So I'd just try reinstalling the client and
reapplying the last service pack.
On the account, Try adding the local account you created to
the local administrators on your PC and make sure to add it
to the sysadmins server role on your PC. Then try changing
the service account in Enterprise Manager.
-Sue
On Tue, 15 Aug 2006 06:07:01 -0700, Mike Collins
<MikeCollins@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Ok...I tried what you suggested with no luck. I'm thinking of maybe
>reinstalling SQL Server.
>For Query Analyzer, I tried replacing the file as you suggested but had the
>same results (Enterprise Manager starts up fine, but still cannot start QA
>from within Enterprise Manager).
>Changing the password. I created an account on my laptop and changed SQL
>Server from the system account to a local one and got the following message
:
>"Unable to detect the status of Full Text Search service or unable to start
>the service. Continuing to change the account might affect Full Text Search
>service later. Would you like to continue?". I wasn't sure what to do from
>there, so I cancelled.
>Any suggestions?
>"Sue Hoegemeier" wrote:
>|||Thanks. I got the login issue to work, and I will reinstall client tools whe
n
I get a chance. Thanks again for your help.
"Sue Hoegemeier" wrote:

> On the Query Analyzer issue, try reinstalling the client
> tools. If that still doesn't work, I have no idea how it
> broke. Check that isqlw.exe has not been moved from the
> default installation location, make sure the tools directory
> is in your environment path, make sure you can access Query
> Analyzer by typing isqlw from the run command, etc. But for
> all of those issues, you should be getting a file not found
> error. So I'd just try reinstalling the client and
> reapplying the last service pack.
> On the account, Try adding the local account you created to
> the local administrators on your PC and make sure to add it
> to the sysadmins server role on your PC. Then try changing
> the service account in Enterprise Manager.
> -Sue
> On Tue, 15 Aug 2006 06:07:01 -0700, Mike Collins
> <MikeCollins@.discussions.microsoft.com> wrote:
>
>

Sunday, February 12, 2012

Cannot connect to Local after change domain password

I have a Developer copy of Sql Server on my XP workstation, which I use to
access the Domain server's Sql Data and a local (name of my workstation) set
of practice data in a seperate sql server registration.
If I change my password on the domain, I can no longer connect to the local
server.
I'm running mixed mode on both with the sa login and a non-blank password.
I uninstalled my local copy of sql server, deleted the registry files I
could find, re-installed sql to a different drive partition, and then it
immediately showed the domain server registration but logon failure to the
local server registration.
I then changed my domain password back to what it used to be and everything
works fine. Problem is, my domain password is compromised and I need to
change it.
How do I clear all the real data about my install or get it to accept my new
authentication?
Bob Graham
My problem seems to have gone away after changing my network password back
to the same new one a second time.
As though it took several 'hits' to get sql to recognize the password
change.
Bob
"Bob Graham" <rvgtech@.pacbell.net> wrote in message
news:Io8ce.2370$zu.852@.newssvr13.news.prodigy.com. ..
> I have a Developer copy of Sql Server on my XP workstation, which I use
to
> access the Domain server's Sql Data and a local (name of my workstation)
set
> of practice data in a seperate sql server registration.
> If I change my password on the domain, I can no longer connect to the
local
> server.
> I'm running mixed mode on both with the sa login and a non-blank password.
> I uninstalled my local copy of sql server, deleted the registry files I
> could find, re-installed sql to a different drive partition, and then it
> immediately showed the domain server registration but logon failure to the
> local server registration.
> I then changed my domain password back to what it used to be and
everything
> works fine. Problem is, my domain password is compromised and I need to
> change it.
> How do I clear all the real data about my install or get it to accept my
new
> authentication?
> Bob Graham
>

Cannot connect to Local after change domain password

I have a Developer copy of Sql Server on my XP workstation, which I use to
access the Domain server's Sql Data and a local (name of my workstation) set
of practice data in a seperate sql server registration.
If I change my password on the domain, I can no longer connect to the local
server.
I'm running mixed mode on both with the sa login and a non-blank password.
I uninstalled my local copy of sql server, deleted the registry files I
could find, re-installed sql to a different drive partition, and then it
immediately showed the domain server registration but logon failure to the
local server registration.
I then changed my domain password back to what it used to be and everything
works fine. Problem is, my domain password is compromised and I need to
change it.
How do I clear all the real data about my install or get it to accept my new
authentication?
Bob GrahamMy problem seems to have gone away after changing my network password back
to the same new one a second time.
As though it took several 'hits' to get sql to recognize the password
change.
Bob
"Bob Graham" <rvgtech@.pacbell.net> wrote in message
news:Io8ce.2370$zu.852@.newssvr13.news.prodigy.com...
> I have a Developer copy of Sql Server on my XP workstation, which I use
to
> access the Domain server's Sql Data and a local (name of my workstation)
set
> of practice data in a seperate sql server registration.
> If I change my password on the domain, I can no longer connect to the
local
> server.
> I'm running mixed mode on both with the sa login and a non-blank password.
> I uninstalled my local copy of sql server, deleted the registry files I
> could find, re-installed sql to a different drive partition, and then it
> immediately showed the domain server registration but logon failure to the
> local server registration.
> I then changed my domain password back to what it used to be and
everything
> works fine. Problem is, my domain password is compromised and I need to
> change it.
> How do I clear all the real data about my install or get it to accept my
new
> authentication?
> Bob Graham
>

Cannot connect to database using SQL Authentification !!!!!!

I cannot connect to my database using SQL Authentification for a user who is working fine. I know I'm putting the right username and password because I just recently logged in using Windows Authentification to my database, and retyped the password just to be sure it's right. I even tried createing a new sql login and tried that, no luck.

And yes, SQL is in mixed mode for Authentification as it has been all along.


error when trying to connect is:

TITLE: Connect to Server

Cannot connect to (local).

ADDITIONAL INFORMATION:
Login failed for user 'sqlapps'. (Microsoft SQL Server, Error: 18456)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

BUTTONS:
OK

Out of curiosity, can you login as sa?