RE: Receiving JDBC error when executing program - Login failed for user 'sa'



Hello,

Are you positive you are using a uid/pwd other than sa? The error message
says we're using 'sa' so I would think that's the username being passed in.
The JDBC driver cannot connect using integrated authentication, it only
uses SQL authentication.

Can you test with a simple console application that you can indeed connect
with the right credentials?

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection con =

DriverManager.getConnection("jdbc:microsoft:sqlserver://myserver;","uid","pw
d");

Thanks,
Kamil

Kamil Sykora
Microsoft Developer Support - Web Data

Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.


Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/secur­ity.



--------------------
| From: war_wheelan@xxxxxxxxx
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| Subject: Receiving JDBC error when executing program - Login failed for
user 'sa'
| Date: 13 Jul 2005 08:23:16 -0700
| Organization: http://groups.google.com
| Lines: 71
| Message-ID: <1121268196.842292.232280@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
|
| I am receiving the following error when attempting to run my database
| application. The batch file that runs this program uses a different
| username and password than 'sa'. I tried to login the 'sa' account
| with Query Manager and received the 18456 error msg. I reset the 'sa'
| account's password and I can now login to Query Manager, but still
| receive the same error. The server is in mixed mode authentication so
| I don't know what's the problem. I have an identically configured
| server that uses this batch file and it runs properly.
|
| Can anyone help me?
|
| ERROR
| Testing database retrieval
| conn.createStatement failed: java.sql.SQLException:
| [Microsoft][SQLServer 2000 Driver for JDBC][SQLS
| erver]Login failed for user 'sa'.
|
| java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
| JDBC][SQLServer]Login failed for user '
| sa'.
| at
| com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
| at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown
| Source)
| at
| com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
| Source)
| at
| com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
| Source)
| at
|
com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown
| Source)
| at
| com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown
| Source)
| at
|
com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknow
n
| Source)
| at
| com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown
| Source)
| at
| com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
| at
| com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown
| Source)
| at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown
| Source)
| at
| com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown
| Source)
| at
| com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown
| Source)
| at db.IndiiDBNode.initDB(IndiiDBNode.java:235)
| at db.IndiiDBInit.pstat(IndiiDBInit.java:52)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
| Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at OSBean.ObjectSwitch.pstat(SourceFile:168)
| at OSBean.aa.processClosure(SourceFile:416)
| at OSBean.OS_Process.run(SourceFile:302)
| at java.lang.Thread.run(Unknown Source)
| Connected to database
| Uplink Poller Started
| Could not load application properties. app.properties is not specified
| ERROR
|
|

.



Relevant Pages

  • Re: Enter user name, enter password, then press enter...
    ... What do you do when the customer asks that the database login in be the same ... username and password to use all of the stuff that she is permitted to use. ... I have implemented this type of security for Access, VB, and Web Based ASP ...
    (microsoft.public.access.forms)
  • Re: Dynamic SQL
    ... Don't need to login to the database. ... OF course entering username N00bHax0r') will cause an error. ... // is the Validators good for this ????? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Login fails. Why?
    ... the 'UserName' login has not been granted access to the ... The user will need permissions on referenced database objects, ... SQL Server MVP ...
    (microsoft.public.sqlserver.security)
  • Re: Synchronize Active Directory with a SQL-Server database
    ... users of the Active Directory. ... on the login I check if the user exist in the AD too. ... username and the password on the database. ... So I need the record of the users in the database to have the same ...
    (microsoft.public.windows.server.scripting)
  • Re: Pathname to access and usernames in shortcut
    ... >> network drive (for maintenance reasons initially, ... >> using usernames but no passwords. ... change their passwords within the access database (they won't know how ... >> gets the current username from the system and then calls access (via the ...
    (microsoft.public.access.security)

Loading