Skip to content
Advertisement

How to set a connection from eclipse to SQLServer?

I am trying to connect to SQL Server from eclipse and i get the following error. I mention that i verified and the SQL Server Browser is running on the host and i have no firewall active.

This is the code i’ve written:

Advertisement

Answer

First thing before DB programming. Test each “step”. Before executing any query or even writing any other code, please check if you can connect to the DB. I assume that you are connecting to the local db. For steps on making your connection URL, see – http://technet.microsoft.com/en-us/library/ms378428.aspx

Try changing your URL to – jdbc:sqlserver://localhost;user=Mine;password=Secret;databaseName=MyDB. I tried this code and it worked.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement