connecting to remote SQL server

How to connect to a remote database server(SQL server 2005) using JSP?

I know this connectivity for local host, but don't know how to do this for a remote database server.
I don't know how to check that the server is configured for outside access.
Is JTDS a solution for this problem? If so how to place the jar file in the classpath?

How to connect to a remote database server(SQL server 2005) using JSP?
I know this connectivity for local host, but don't know how to do this for a remote database server.

Change "localhost" in the URL to the server ip address/hostname, maybe? Have you even tried?

I don't know how to check that the server is configured for outside access.

Speak with the administrators of the servers (and network because of possible firewall/proxy issues), or if they are yours, find correspondings forums, as those issues are system issues, and not Java issues.

Is JTDS a solution for this problem? If so how to place the jar file in the classpath?

Thanks in advance.

Seeing as how that is a JDBC Driver for MS SQL Server (If I remember right), yes. Check the documentation for your app server / web container.

re:

You can do it in DSN settings, go through it carefully, select the name of other machine on network(if on network, u can see), instead of localhost or '.', most people do, when i changed it worked for me.