none
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection reset

    Question

  • Hi everyone, I hope you could help me:

    I´m trying to access my database, working with JBuilder 7 and MySql. I have the following code:

    public Conexion() throws Exception {

          Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

    //The error is in this statement
          Connection con = DriverManager.getConnection("jdbc:microsoftTongue Tiedqlserver://localhost:3306;DatabaseName=gescom;user=root;password=gestion");

          if (con != null) {
          System.out.println();
          System.out.println("Successfully connected");
          System.out.println();
         
    }

    I print here the error trace:

    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection reset
        at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
        at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
        at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
        at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
        at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
        at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
        at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:193)
        at gescom.Conexion.<init>(Conexion.java:22)
        at gescom.gestion_comercio.main(gestion_comercio.java:59)


    Thank you.... your friend and neighbour superTony....dioldiol
    Thursday, August 07, 2008 12:34 PM

Answers

  • Hi Tony,

     

    Are you trying to connect to Microsoft SQL Server 2000 or MySql?

    From the exception message you posted, you are using a Microsoft SQL Server 2000 driver.  I would be surprised if the same driver will work with MySql.

     

    If you are trying to connection to SQL Server, which version of SQL Server are you trying to connect to?

    If you are trying to connect to SQL Server 2005, I recommend that you try the Microsoft SQL Server 2005 JDBC driver v1.2 that is available at http://msdn.microsoft.com/data/jdbc

     

    HTH,

    Jimmy

     

    Thursday, August 07, 2008 11:31 PM
    Moderator

All replies

  • Hi Tony,

     

    Are you trying to connect to Microsoft SQL Server 2000 or MySql?

    From the exception message you posted, you are using a Microsoft SQL Server 2000 driver.  I would be surprised if the same driver will work with MySql.

     

    If you are trying to connection to SQL Server, which version of SQL Server are you trying to connect to?

    If you are trying to connect to SQL Server 2005, I recommend that you try the Microsoft SQL Server 2005 JDBC driver v1.2 that is available at http://msdn.microsoft.com/data/jdbc

     

    HTH,

    Jimmy

     

    Thursday, August 07, 2008 11:31 PM
    Moderator
  • hello jimmy
    I was trying to connect to MySql, and I was using the wrong driver, puffffffff!!!!

    you was very helpful, thank you.


    Monday, August 18, 2008 11:53 AM
  • hi Jimmy ,

    i am also facing the same issue.Please see this below,

    java.sql.SQLEXCEPTION :[microsoft][sqlserver 2000 driver forJDBC] connection reset"

         while executing

    "$pstmt executeQuery "SELECT InstallReqID FROM STAutorequest where ID='$iReqID'"

          (procedure "GetInstallID" line4)

           invoked from within

    "GetInstallID $iReqID"

         (procedure "CreateEmailReport" line26)

    and we are using MS SQL 2005..please help me on this urgently

    Thursday, January 10, 2013 10:12 AM