Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL server connection using java

Author  Topic 

romy
Starting Member

6 Posts

Posted - 2007-05-24 : 12:30:15
Hi,

I want to connect to sql server using java and want retrive data.

I am getting following exception:

[Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL.

My url

String url = "jdbc:microsoft:sqlserver://servername:6013/databasename";

please let me know if any thing wrong in my url.

Thanks,

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-25 : 03:38:36
Your connection URL is not proper. Try this:

String url = "jdbc:microsoft:sqlserver://serverName:6013;databaseName=<somedb>";

Replace <somedb> with the name of your database.


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -