I have a stand alone app to connect to a remote SQL server db. It worked fine until I changed the database URL to "jdbc:microsoft:sqlserver://10.XXX.XXX.XX\\ENGINE:1433;DatabaseName=TEST". I keep getting "SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket" whenever I call DriverManager.getConnection. I don't know if it's because of "\\" in url. I am stuck here, can someone please help. Thanks in advance.
"Hope", We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Thanks! bear Forum Bartender
David, Thanks for your prompt reply. To your questions, my answer is: Yes, I can ping the remote machine and I am 100% sure there is a SQL server database running on that machine. Actually I can connect to that database from my machine via Enterprise Manager if a server alias has been created for that server.
A handy way to debug JDBC URL problems without needing to recompile is to use a Java Database client like Squirrel SQL. You can put in your connection details to see if it works, ad just try again if it doesn't. You can get Squirrel (for free) here
posted 15 years ago
Thanks a lot, David! You are correct, I was given a wrong server name.
He got surgery to replace his foot with a pig. He said it was because of this tiny ad: