In order to better assist troubleshooting JDBC and JDBC related connectivity issues, the more specific the problem you describe, the faster we can help you out. Please take a few minutes to answer the following questions and post the answers as much as possible along with your specific repro steps.
http://blogs.msdn.com/jdbcteam/ or http://blogs.msdn.com/sql_protocols/ may already have your question answered. Check them out.
[1] Client side:
- Which OS platform are you running on? (please specify)
-
Which JVM are you running on? (please specify)
-
What is the connection URL in you app? (please specify)
- If client fails to connect, what is the client error messages? (please specify)
- Is the client remote or local to the SQL server machine? [Remote | Local]
- Is your client computer in the same domain as the Server computer? (Same domain | Different domains | WorkGroup)
[2] Server side:
- What is the MS SQL version? [ SQL Server 2000 | SQL Sever 2005]
- Does the server start successfully? [YES | NO] If not what is the error messages in the SQL server ERRORLOG?
- If SQL Server is a named instance, is the SQL browser enabled? [YES | NO]
- What is the account that the SQL Server is running under?[Local System | Network Service | Domain Account]
- Do you make firewall exception for your SQL server TCP port if you want connect remotely through TCP provider? [YES | NO | not applicable]
- Do you make firewall exception for SQL Browser UDP port 1434? In SQL2000, you still need to make firewall exception for UDP port 1434 in order to support named instance.[YES | NO | not applicable ]
Tips:
-
If you are executing a complex statement query or stored procedure, please use execute() instead of executeQuery().
-
If you are using JDBC transactions, do not mix them with T-SQL transactions.
Last but not least:
There is a wealth of information already available to help you answer your questions.
(1) SQL Server 2005 Books Online: http://msdn2.microsoft.com
(2) MSDN JDBC site: http://msdn.microsoft.com/data/jdbc
(3) MSN Search: http://www.live.com or use your favorite search engine.