11 Replies Latest reply on Mar 12, 2008 9:19 PM by 843859

    MS-SQL TDS error

    843859
      I get two diffrent errors with my applet.. when it works with MS-SQL but only sometimes.. other times it works fine (*sigh*.. a random thing again) oh and with MySQL it always works fine

      these are the two I get in console.. and I don't understand them
      I have the microsoft 1.2 JDBC driver
      and Microsoft SQL server 2005
      basic: New window ID: 36049c3
      basic: Value of xembed: 1
      basic: setWindow: call before applet exists:36049c3
      basic: Referencing classloader: sun.plugin.ClassLoaderInfo@1eef0a8, refcount=1
      basic: Added progress listener: sun.plugin.util.GrayBoxPainter@7a7f6b
      basic: Loading applet ...
      basic: Initializing applet ...
      basic: Starting applet ...
      basic: completed perf rollup
      network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
      network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.class, version: null]
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.class with proxy=DIRECT
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.class with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
      network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.properties, version: null]
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.properties with proxy=DIRECT
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.properties with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
      network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.class, version: null]
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.class with proxy=DIRECT
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.class with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
      network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.properties, version: null]
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.properties with proxy=DIRECT
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.properties with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
      com.microsoft.sqlserver.jdbc.SQLServerException: The result set is closed.
           at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.checkClosed(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(Unknown Source)
           at Main.Laden(Main.java:1019)
           at Main.init(Main.java:267)
           at sun.applet.AppletPanel.run(AppletPanel.java:419)
           at java.lang.Thread.run(Thread.java:619)
      network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
      network: Cache entry found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/organisatieschema.jar, version: null]
      basic: New window ID: 3604eaf
      basic: Value of xembed: 1
      basic: setWindow: call before applet exists:3604eaf
      basic: Referencing classloader: sun.plugin.ClassLoaderInfo@1eef0a8, refcount=1
      basic: Added progress listener: sun.plugin.util.GrayBoxPainter@1ba4a47
      basic: Loading applet ...
      basic: Initializing applet ...
      basic: Starting applet ...
      basic: completed perf rollup
      network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/org/jdesktop/swingx/plaf/resources/swingx.class, version: null]
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/org/jdesktop/swingx/plaf/resources/swingx.class with proxy=DIRECT
      network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/org/jdesktop/swingx/plaf/resources/swingx.class with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
      network: Cache entry found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/swingx-0.9.0.jar, version: null]
      network: No certificate info for unsigned JAR file: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/swingx-0.9.0.jar
      network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
      28-jan-2008 7:57:29 com.microsoft.sqlserver.jdbc.TDSReader throwInvalidTDS
      SEVERE: TDSReader@101f935 ( ConnectionID:7 TransactionID:0x0000000000000000) got unexpected value in TDS response at offset:1503
      com.microsoft.sqlserver.jdbc.SQLServerException: Unexpected IOException processing character stream Reader.
           at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
           at com.microsoft.sqlserver.jdbc.DDC.convertReaderToString(Unknown Source)
           at com.microsoft.sqlserver.jdbc.DDC.convertNonUnicodeNonPLPToObject(Unknown Source)
           at com.microsoft.sqlserver.jdbc.ServerDTVImpl.getValue(Unknown Source)
           at com.microsoft.sqlserver.jdbc.DTV.getValue(Unknown Source)
           at com.microsoft.sqlserver.jdbc.Column.getValue(Unknown Source)
           at com.microsoft.sqlserver.jdbc.Column.getValue(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getString(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getString(Unknown Source)
           at Main.Laden(Main.java:1024)
           at Main.init(Main.java:267)
           at sun.applet.AppletPanel.run(AppletPanel.java:419)
           at java.lang.Thread.run(Thread.java:619)
      com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
           at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.checkClosed(Unknown Source)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(Unknown Source)
           at Boom.MaakBoomStructuur(Boom.java:241)
           at Boom.access$0(Boom.java:110)
           at Boom$2.run(Boom.java:74)
           at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
           at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
           at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
           at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
           at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
           at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
      network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
      network: Cache entry found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/organisatieschema.jar, version: null]
        • 1. Re: MS-SQL TDS error
          jschellSomeoneStoleMyAlias
          Closed result set is probably your problem. You are probably reusing connections/statements/resultsets in ways that will not work.

          The other could either be a bug in the driver or because you are using a driver that doesn't match your database.

          Note that there is a free MS SQL Server driver on souceforge.net which people have reported good things about.
          • 2. Re: MS-SQL TDS error
            843859
            then how would you explain that it works fine with MySQL and in appletviewer

            I only have this problem with MS-SQL in browser (both IE and Firefox) and you'll only get it like once every 10 reloads or so (a bit more random than that though)

            **EDIT**
            tried the driver from sourceforge.. the jtds thingy
            http://jtds.sourceforge.net/index.html

            gives same result.. with diffrent error
            java.sql.SQLException: Invalid state, the ResultSet object is closed.
            
                 at net.sourceforge.jtds.jdbc.JtdsResultSet.checkOpen(JtdsResultSet.java:299)
            
                 at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:569)
            
                 at Main.Laden(Main.java:1026)
            
                 at Main.init(Main.java:270)
            
                 at sun.applet.AppletPanel.run(Unknown Source)
            
                 at java.lang.Thread.run(Unknown Source)
            
            java.sql.SQLException: Invalid state, the ResultSet object is closed.
            
                 at net.sourceforge.jtds.jdbc.JtdsResultSet.checkOpen(JtdsResultSet.java:299)
            
                 at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:569)
            
                 at Main.Laden(Main.java:1026)
            
                 at Main.init(Main.java:270)
            
                 at sun.applet.AppletPanel.run(Unknown Source)
            
                 at java.lang.Thread.run(Unknown Source)
            
            java.sql.SQLException: TDS Protocol error: Invalid packet type 0x0
            
                 at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2314)
            
                 at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:764)
            
                 at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:593)
            
                 at Main.Laden(Main.java:1026)
            
                 at Main.init(Main.java:270)
            
                 at sun.applet.AppletPanel.run(Unknown Source)
            
                 at java.lang.Thread.run(Unknown Source)
            
            Caused by: net.sourceforge.jtds.jdbc.ProtocolException: Invalid packet type 0x0
            
                 at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2301)
            
                 ... 6 more
            
            java.sql.SQLException: TDS Protocol error: Invalid packet type 0x0
            
                 at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2314)
            
                 at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:728)
            
                 at net.sourceforge.jtds.jdbc.JtdsStatement.initialize(JtdsStatement.java:645)
            
                 at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1285)
            
                 at Boom.MaakBoomStructuur(Boom.java:127)
            
                 at Boom.access$0(Boom.java:110)
            
                 at Boom$2.run(Boom.java:74)
            
                 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            
                 at java.awt.EventQueue.dispatchEvent(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            
                 at java.awt.EventDispatchThread.run(Unknown Source)
            
            Caused by: net.sourceforge.jtds.jdbc.ProtocolException: Invalid packet type 0x0
            
                 at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2301)
            
                 ... 14 more
            
            java.sql.SQLException: Invalid state, the Statement object is closed.
            
                 at net.sourceforge.jtds.jdbc.JtdsStatement.checkOpen(JtdsStatement.java:220)
            
                 at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1284)
            
                 at Boom.MaakBoomStructuur(Boom.java:148)
            
                 at Boom.access$0(Boom.java:110)
            
                 at Boom$2.run(Boom.java:74)
            
                 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            
                 at java.awt.EventQueue.dispatchEvent(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            
                 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            
                 at java.awt.EventDispatchThread.run(Unknown Source)
            **EDIT2**
            the line on which it gives the error would be this:
            while (resultset.next()) {
            and after that while the resultset gets closed..

            Edited by: Nizzle on Jan 29, 2008 9:30 AM

            Edited by: Nizzle on Jan 29, 2008 10:19 AM
            • 3. Re: MS-SQL TDS error
              843859
              Nizzle wrote:
              java.sql.SQLException: Invalid state, the ResultSet object is closed.
              java.sql.SQLException: TDS Protocol error: Invalid packet type 0x0
              java.sql.SQLException: Invalid state, the Statement object is closed.
              It seems to indicate that the problem is with the way you are reusing connections/statements/resultsets as jschell already suggested. Posting your code here would help confirm the cause.
              • 4. Re: MS-SQL TDS error
                843859
                ah well I could try to give you some relevant code..
                     private Connection                    connection;
                     static Statement                    statement;
                
                     private String                         JDBC_DRIVER;
                     private String                         DATABASE_URL;
                     private String                         USERNAME;
                     private String                         PASSWORD;
                USERNAME = getParameter("Username");
                          PASSWORD = getParameter("Password");
                
                          if (getParameter("DatabaseType").equals("MySQL")) {
                               JDBC_DRIVER = "com.mysql.jdbc.Driver";
                               DATABASE_URL = "jdbc:mysql://" + getParameter("Server") + ":3306/" + getParameter("Database");
                          }
                          else if (getParameter("DatabaseType").equals("MS-SQL")) {
                               JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
                               DATABASE_URL = "jdbc:sqlserver://" + getParameter("Server") + ":1433;DatabaseName=" + getParameter("Database")
                                         + ";SelectMethod=Direct";
                          }
                
                          try {
                               /* Driver Laden */
                               if (Main.debug) {
                                    System.out.println("=> " + getParameter("DatabaseType") + " Driver Laden:");
                               }
                               Class.forName(JDBC_DRIVER).newInstance();
                               if (Main.debug) {
                                    System.out.println("=> Verbinden:");
                                    System.out.println(DATABASE_URL);
                               }
                               connection = DriverManager.getConnection(DATABASE_URL, USERNAME, PASSWORD);
                               statement = connection.createStatement();
                          }
                          catch (final Exception e) {
                               e.printStackTrace();
                               BooleanVerbindingGemaakt = false;
                          }
                
                          if (BooleanVerbindingGemaakt) {
                               if ((getParameter("teLaden") == null) || (getParameter("teLaden").length() == 0) || ((getParameter("ID")) == null)
                                         || (getParameter("ID")).length() == 0) {
                                    Main.teLaden = Item.HOOFDSCHEMA;
                               }
                               else {
                                    Main.chartID = Integer.parseInt(getParameter("ID"));
                                    Main.teLaden = getParameter("teLaden");
                               }
                
                               // make GUI stuff..
                               Laden(chartID, teLaden);
                public final void Laden(final int id, final String laadType) {
                          organisatiePanel.removeAll();
                          int grootsteX = 0;
                          int grootsteY = 0;
                
                          Main.chartID = id;
                
                          Main.ID = ZoekGrootsteID();
                
                          try {
                               final String sql;
                
                               if (laadType.toLowerCase().equals(Item.HOOFDSCHEMA)) {
                                    sql = "SELECT * FROM hoofdschema";
                               }
                               else {
                                    final String schemaString;
                
                                    if (getParameter("DatabaseType").toLowerCase().equals("ms-sql")) {
                                         schemaString = "[schema]";
                                    }
                                    else {
                                         schemaString = "schema";
                                    }
                
                                    sql = "SELECT * FROM organisatieschema WHERE chartID = " + id + " AND " + schemaString + " = '" + laadType + "'";
                               }
                
                               if (Main.debug) {
                                    System.out.println(sql);
                               }
                
                               final ResultSet resultset = statement.executeQuery(sql);
                
                               // doorloop de resultaten van de query
                               while (resultset.next()) {
                                    final int ID = resultset.getInt("ID");
                                    final int PosX = resultset.getInt("PosX");
                                    final int PosY = resultset.getInt("PosY");
                                    final String text = resultset.getString("text");
                                    final String type = resultset.getString("type");
                                    final int lijnStijl = resultset.getInt("lijnStijl");
                                    final int lijnDikte = resultset.getInt("lijnDikte");
                                    final Color lijnKleur = new Color(Integer.parseInt(resultset.getString("lijnKleur"), 16));
                                    final int markeringBreedte = resultset.getInt("markeringBreedte");
                                    final int markeringHoogte = resultset.getInt("markeringHoogte");
                                    final Color markeringKleur = new Color(Integer.parseInt(resultset.getString("markeringKleur"), 16));
                                    final Color kleur = new Color(Integer.parseInt(resultset.getString("kleur"), 16));
                                    final int lijnBoven = resultset.getInt("lijnBoven");
                                    final int lijnLinks = resultset.getInt("lijnLinks");
                                    final int lijnRechts = resultset.getInt("lijnRechts");
                                    final int lijnOnder = resultset.getInt("lijnOnder");
                                    final int koppelID = resultset.getInt("koppelID");
                                    final String koppelNaam = resultset.getString("koppelNaam");
                                    final int x1 = PosX * (Main.BREEDTE + Main.CONNECTOR_BREEDTE);
                                    final int y1 = PosY * (Main.HOOGTE + Main.CONNECTOR_HOOGTE);
                
                                    final Item item = new Item(type);
                                    item.setID(ID);
                                    item.setPosX(PosX);
                                    item.setPosY(PosY);
                                    item.setText("<html><center><p>" + text + "</p></center></html>");
                                    item.setToolTipText("<html><center><p><b>" + type + ":</b></p><p>" + text + "</p></center></html>");
                                    item.setLijnStyle(lijnStijl);
                                    item.setLijnDikte(lijnDikte);
                                    item.setLijnKleur(lijnKleur);
                                    item.setMarkeringBreedte(markeringBreedte);
                                    item.setMarkeringHoogte(markeringHoogte);
                                    item.setMarkeringKleur(markeringKleur);
                                    item.setBackground(kleur);
                                    item.setLijnBoven(lijnBoven);
                                    item.setLijnLinks(lijnLinks);
                                    item.setLijnRechts(lijnRechts);
                                    item.setLijnOnder(lijnOnder);
                                    item.setKoppelID(koppelID);
                                    item.setKoppelNaam(koppelNaam);
                                    item.setBounds(x1, y1, Main.BREEDTE, Main.HOOGTE);
                
                                    organisatiePanel.add(item);
                                    organisatiePanel.buttonInMouseListener(item);
                
                                    if (x1 + Main.BREEDTE > grootsteX) {
                                         grootsteX = x1 + Main.BREEDTE;
                                    }
                                    if (y1 + Main.HOOGTE > grootsteY) {
                                         grootsteY = y1 + Main.HOOGTE;
                                    }
                               }
                
                               resultset.close();
                          }
                          catch (final Exception e) {
                               e.printStackTrace();
                          }
                there's more.. but it all goes wrong in this part..

                **EDIT**
                tried the "merlia" driver thingy (trial) from here
                https://www.inetsoftware.de/Download.htm

                and that one gives me another error..
                com.inet.tds.Tds4SQLException: Too many connections :3
                
                     at com.inet.tds.aa.a(Unknown Source)
                
                     at com.inet.tds.n.<init>(Unknown Source)
                
                     at com.inet.tds.an.<init>(Unknown Source)
                
                     at com.inet.tds.aa.a(Unknown Source)
                
                     at com.inet.tds.TdsDriver.connect(Unknown Source)
                
                     at java.sql.DriverManager.getConnection(Unknown Source)
                
                     at java.sql.DriverManager.getConnection(Unknown Source)
                
                     at Main.start(Main.java:296)
                
                     at sun.applet.AppletPanel.run(Unknown Source)
                
                     at java.lang.Thread.run(Unknown Source)
                
                com.inet.tds.Tds4SQLException: ResultSet is closed.
                
                     at com.inet.tds.aa.a(Unknown Source)
                
                     at com.inet.tds.am.b(Unknown Source)
                
                     at com.inet.tds.am.getLong(Unknown Source)
                
                     at com.inet.tds.am.getInt(Unknown Source)
                
                     at com.inet.tds.am.getInt(Unknown Source)
                
                     at Main.Laden(Main.java:1029)
                
                     at Main.init(Main.java:272)
                
                     at sun.applet.AppletPanel.run(Unknown Source)
                
                     at java.lang.Thread.run(Unknown Source)
                
                com.inet.tds.Tds4SQLException: Too many connections :3
                
                     at com.inet.tds.aa.a(Unknown Source)
                
                     at com.inet.tds.n.<init>(Unknown Source)
                
                     at com.inet.tds.an.<init>(Unknown Source)
                
                     at com.inet.tds.aa.a(Unknown Source)
                
                     at com.inet.tds.TdsDriver.connect(Unknown Source)
                
                     at java.sql.DriverManager.getConnection(Unknown Source)
                
                     at java.sql.DriverManager.getConnection(Unknown Source)
                
                     at Main.start(Main.java:296)
                
                     at sun.applet.AppletPanel.run(Unknown Source)
                
                     at java.lang.Thread.run(Unknown Source)
                Edited by: Nizzle on Jan 29, 2008 3:22 PM
                • 5. Re: MS-SQL TDS error
                  jschellSomeoneStoleMyAlias
                  then how would you explain that it works fine with MySQL and in appletviewer
                  Well of course one reason would be because you are using a different driver. As I suggested one source of the problem is the driver itself.

                  Other than that how you use it can drive to the result set problem. Just because one driver doesn't immediately exhibit the problem doesn't rule out the possibility that the problem exists.
                  • 6. Re: MS-SQL TDS error
                    jschellSomeoneStoleMyAlias
                    Are you only creating one connection/statement ever?

                    If yes then how do you know that?

                    If no then....you are not closing your statements and connections.

                    Are you only accessing the result set code with one thread?

                    If yes then how do you know that?

                    If no then that is likely to be your problem. You need more than one result set (which probably won't be the case with a different driver.)
                    • 7. Re: MS-SQL TDS error
                      843859
                      jschell wrote:
                      Are you only creating one connection/statement ever?
                      Yes one connection, one statement and a couple of preparedstatements
                      If yes then how do you know that?
                      for I only have one connection and one statement in my Main and those get passed around..
                      If no then....you are not closing your statements and connections.
                      it was yes and I close them in the applet's stop()
                      Are you only accessing the result set code with one thread?
                      Yes
                      If yes then how do you know that?
                      Because I haven't declared multiple threads
                      If no then that is likely to be your problem. You need more than one result set (which probably won't be the case with a different driver.)
                      it was yes but just to rule it out I tried a couple of drivers.. all gives errors after 10 reloads or so.. error message being diffrent though
                      • 8. Re: MS-SQL TDS error
                        jschellSomeoneStoleMyAlias
                        it was yes and I close them in the applet's stop()
                        I am not a applet/GUI person but I suspect that is a bad idea. The applet runs in a sandbox however that doesn't mean it is entirely independent nor that it is entirely controlled, but again I could be mistaken.

                        I would suppose that you would be better off just creating them as you needed them.
                        Because I haven't declared multiple threads
                        GUIs always mean multi-threaded.
                        all gives errors after 10 reloads or so
                        Then your code is definitely the problem.
                        • 9. Re: MS-SQL TDS error
                          843859
                          somehow I've made the thing less random..


                          1st reload: fine
                          2nd:
                          31-jan-2008 8:24:15 com.microsoft.sqlserver.jdbc.TDSReader throwInvalidTDS
                          SEVERE: TDSReader@17fc44f ( ConnectionID:3 TransactionID:0x0000000000000000) got unexpected value in TDS response at offset:1503
                          31-jan-2008 8:24:15 com.microsoft.sqlserver.jdbc.TDSReader throwInvalidTDS
                          SEVERE: TDSReader@17fc44f ( ConnectionID:3 TransactionID:0x0000000000000000) got unexpected value in TDS response at offset:1503
                          31-jan-2008 8:24:16 com.microsoft.sqlserver.jdbc.SQLServerStatement clearLastResult
                          WARNING: SQLServerStatementID:7 ( ConnectionID:3 TransactionID:0x0000000000000000): Error (ignored) closing ResultSet ID:350 ( ConnectionID:3 TransactionID:0x0000000000000000)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid.
                          at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.throwInvalidTDS(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.TDSReader.throwInvalidTDS(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.TDSReader.skip(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.ServerDTVImpl.skipValue(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.DTV.skipValue(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.Column.skipValue(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.skipColumns(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.discardCurrentRow(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(Unknown Source)
                               at Main.Laden(Main.java:1027)
                               at Main.init(Main.java:274)
                               at sun.applet.AppletPanel.run(AppletPanel.java:419)
                               at java.lang.Thread.run(Thread.java:619)
                          31-jan-2008 8:28:01 com.microsoft.sqlserver.jdbc.SQLServerStatement clearLastResult
                          WARNING: SQLServerStatementID:7 ( ConnectionID:3 TransactionID:0x0000000000000000): Error (ignored) closing ResultSet ID:342 ( ConnectionID:3 TransactionID:0x0000000000000000)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid.
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.throwInvalidTDS(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.TDSReader.throwInvalidTDS(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.TDSReader.skip(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.ServerDTVImpl.skipValue(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.DTV.skipValue(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.Column.skipValue(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.skipColumns(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.discardCurrentRow(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerResultSet.close(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.clearLastResult(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.processResults(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.processBatch(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.processResponse(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Boom.MaakBoomStructuur(Boom.java:132)
                               at Boom.access$0(Boom.java:115)
                               at Boom$2.run(Boom.java:79)
                               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                               at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
                          java.lang.NullPointerException
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Boom.MaakBoomStructuur(Boom.java:132)
                               at Boom.access$0(Boom.java:115)
                               at Boom$2.run(Boom.java:79)
                               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                               at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
                               at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Boom.MaakBoomStructuur(Boom.java:153)
                               at Boom.access$0(Boom.java:115)
                               at Boom$2.run(Boom.java:79)
                               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                               at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
                               at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Boom.MaakBoomStructuur(Boom.java:174)
                               at Boom.access$0(Boom.java:115)
                               at Boom$2.run(Boom.java:79)
                               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                               at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
                               at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Boom.MaakBoomStructuur(Boom.java:132)
                               at Boom.access$0(Boom.java:115)
                               at Boom$3.run(Boom.java:84)
                               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                               at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
                               at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Boom.MaakBoomStructuur(Boom.java:153)
                               at Boom.access$0(Boom.java:115)
                               at Boom$3.run(Boom.java:84)
                               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                               at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
                               at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Boom.MaakBoomStructuur(Boom.java:174)
                               at Boom.access$0(Boom.java:115)
                               at Boom$3.run(Boom.java:84)
                               at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                               at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
                               at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                               at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                               at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                               at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                               at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
                          com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
                               at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
                               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
                               at Main.Laden(Main.java:1128)
                               at Main.init(Main.java:274)
                               at sun.applet.AppletPanel.run(AppletPanel.java:419)
                               at java.lang.Thread.run(Thread.java:619)
                          • 10. Re: MS-SQL TDS error
                            843859
                            now works flawlessly with jTDS driver.. I'll stick with that.. crappy MS stuff >_<
                            • 11. Re: MS-SQL TDS error
                              843859
                              Hi,

                              Even we are using latest jtds driver with mssql2005.

                              But we are still facing the "Connection object is closed problem".

                              Please advice.