Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Finding out the correct URL

 
Neha Gap
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am trying out this code..




And this is the output at my console

Does this driver accept my URL? true
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at DBAccess.main(DBAccess.java:14)


Now, I know that the DriverManager accepts the given url, but it wont get a connection. How do I find out the correct URL, I'm using SQL Server 2005 Express edition. If possibly the username, password are incorrect, how can I reset the same?

Thanks!
Neha.
 
Neha Gap
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, well, made a silly mistake out there.
But now I'm getting the error

Does this driver accept my URL? true
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)


I've done everything to enable tcp/ip remote connections on my sql server, but it still gives me this error, besides, I cant even telnet localhost 1433. The etc/services file shows the port number is correct though.

Any idea how to get the thing to work with said port and url?

Thanks!
Neha.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic