Hi,
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)
Please help.
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.
Hi,
The error of TCP/IP has been removed.Now I am getting an error of:
No Suitable Driver for jdbc:sqlserver://localhost;databaseName=attendance","sa",""
Which type of Driver it is talking about.Can you explain..I have included sqljdbc.jar in the libraries but still i am getting the above error.
Can you tell me about driver.
Thanks
I am getting the error:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I have included all jar file.I have checked that TCP/IP is enabled in my system.My system is a standalone computer which is not connected to any network.Please help me in resolving the problem
mohsin sheikh wrote:I am getting the error:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I have included all jar file.I have checked that TCP/IP is enabled in my system.My system is a standalone computer which is not connected to any network.Please help me in resolving the problem
Check that is not stopping the connection. Also worth checking what patch level SQL Server is at, some (very early) versions had issues in their tcp/ip DLLs.
Post by:autobot
Look ma! I'm selling my stuff!
a bit of art, as a gift, the permaculture playing cards