Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Error in connection sql server 2008 using netbeans 7.2

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Error in connection sql server 2008 using netbeans 7.2

    <public class JavaApplication2 {
     
    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    try {
    Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
    String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=Attendance;user=suhail ;password=123456";
    Connection con = DriverManager.getConnection(connectionUrl);
    // String connectionUrl = "jdbc:sqlserver://localhost;integratedSecurity=true";
    // Connection con = DriverManager.getConnection(connectionUrl);
    } catch (SQLException e) {
    System.out.println("SQL Exception: " + e.toString());
    } catch (ClassNotFoundException cE) {
    System.out.println("Class Not Found Exception: " + cE.toString());
    }
    }
    }
    >

    Error msg am getting as:-

    "SQL Exception: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 192.168.0.71, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall."."



    plz help me i have tried many ways for getting connection but still failed to do so
    Thanks


  2. #2
    Junior Member
    Join Date
    Dec 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Error in connection sql server 2008 using netbeans 7.2

    I got the solution finally thanks

Similar Threads

  1. connection with microsoft sql server 2008 using netbeans
    By Indrajeet in forum JDBC & Databases
    Replies: 1
    Last Post: January 15th, 2013, 07:18 AM
  2. Replies: 7
    Last Post: December 28th, 2012, 10:48 AM
  3. Connect to SQL server 2008
    By vahidbakhtiary in forum JDBC & Databases
    Replies: 1
    Last Post: July 2nd, 2012, 10:07 AM
  4. Replies: 1
    Last Post: December 15th, 2011, 08:29 AM
  5. MS SQL server 2005 to 2008 R2 migration
    By sandeep23k in forum JDBC & Databases
    Replies: 3
    Last Post: April 9th, 2011, 10:53 AM