Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDBC-OBDC, java Login failed for user '(null)'. Reason:

Status
Not open for further replies.

sm43

Programmer
Dec 1, 2002
155
US
Hi,
Not sure if this forum belongs here or in 'Java'.

I'm trying to connect to a SQL Server database through a JDBC-ODBC driver. I have the database registered in the ODBC Control Panel under System DSN. I'm using SQL Server Authentication and have a userid and a non-blank password. For some reason, everytime I register the DSN in ODBC, it tests successfully, but the password for the DSN disappears immediately after I 'OK' the ODBC DSN registration. I'm running Windows 2000 Professional and the database is SQL Server 2000. I've just read somewhere that the ODBC Panel won't save the password. You have to pass it in the url. Is this true? Well, anyway, I include the uid and the password in my connection string. I have the following connection url:

"jdbc:eek:dbc:DSNName;UID=user;PWD=pass"

When I do it this way, and run the Java program I get the following error:

java Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.


Do I have to pass the trusted connection information (i.e. whether the connection is to be trusted or not) in the connection url as well?

Also, when I try Windows Authentication in the ODBC Panel, the java progam connects to the SQL Server database, but when it runs a query, it gets the following error:

"Invalid Descriptor Index"

and then,

"Connection is busy with results for another hstmt"

on every subsequent query attempt.

I have no idea what these mean?

The user I'm using to login is given owner rights for the db in SQL Server. It is given no Server Roles.


What's going on? It seems like I'm missing a couple of things here. How can I solve this?


Thanks.

Saad
 
Correction:
"Not sure if this **message** belongs here or in 'Java' forum."


By the way, I've implemented and tested the whole application with MS Access 2000 db and none of these problems occur there. In MS Access, I don't have any serious authentication going on, i.e. no userid and password..


Saad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top