Hi,
Not sure if this message belongs here or in 'SQL Server'.
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:
"jdbcdbcSNName;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?
By the way, I've implemented and tested the whole application with MS Access 2000 db and none of these problems occur with that. In MS Access, I don't have any serious authentication, i.e. no userid and password..
Thanks.
Saad
Not sure if this message belongs here or in 'SQL Server'.
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:
"jdbcdbcSNName;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?
By the way, I've implemented and tested the whole application with MS Access 2000 db and none of these problems occur with that. In MS Access, I don't have any serious authentication, i.e. no userid and password..
Thanks.
Saad