I am building a project in struts.I am using Sql Server 2000 database for backend.
I am getting an exception of"No Suitable Driver" when i am trying to connect to database.
I have successfully build the User DSN say "attendance" using ODBC.
I have used following driver to connect to database:
Now it is giving an error:
Unable to Initialize Data Source (com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect)
Is there any other way to connect to SQL Server 2000?
A DSN should not be required. Why do you want to use ODBC?
Make sure your database instance is configured to accept connections over TCP/IP (for SQL Server 2000 this should be the default case) and make sure it is configured to support SQL Server authentication (by default this is not the case).
I would be very surprised if the port number had been changed and in that instance I'd expect the connection to time out, rather than being refused. The exception message would also be different if a Firewall prevented it - the message would be something like "software caused connection abort". Given SQL Server 2000 is not configured to accept connections using SQL Server authentication by default I would think my second suggestion is the more likely one.