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
dbc
SNName;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
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
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