• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to connect to MS SQL 2005 Evaluation version

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have installed MS SQL 2005 Evaluation version(downloaded from microsoft site) on my win2k3 Enterprise Edition I am writing a java application that connects to MS SQL 2005.

I have downloaded the MS SQL 2005 JDBC driver. And i unjarred the
I have unjarred the sqljdbc.jar file and kept the com folder and my .java file in the same folder.

When i am trying to connect, I am getting the following error:

-------------
com.microsoft.sqlserver.jdbc.SQLServerException: Failed Logon:com.microsoft.sqlserver.jdbc.SQLServerException: TCP/IP connection failed to host:155.35.54.160 java.net.ConnectException: Connection refused:connect
-------------

My code look like this:
---------------------------------------
try {
Class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String fs = File.separator;

String conn_str = "jdbc:sqlserver://155.35.54.160:1433;user=sa;password=SA;databaseName=asdb";

conn = DriverManager.getConnection ( conn_str );
}
catch (Exception e) {System.out.println(e); }


Please reply.
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your MS SQL server on the same machine as you are running your code on, or are they on different boxes? If different boxes, I'd check for a firewall configuration problem. Don't use win2k3, but on winxp you hit that problem.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you configured the security settings of your MSSQL server instance to allow "SQL Server and Windows Authentication"?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic