Java Result: -1073740791

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PreethiGowri
    New Member
    • Oct 2012
    • 126

    Java Result: -1073740791

    Can somebody explain me what does Java Result: -1073740791 mean. I had a code which used to send data that was saved in my mysql database, through ethernet using UDP protocol, everything worked fine until i sent fewer data(25 rows), when i started sending data in huge amount(100 rows) it used to display Java Result: -1073740791 and would stop the running code. Im using jpcap, winpcap and netbeans.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Find out where exactly that message comes from. If it's from one of the third party APIs' method then check it's specs to see when such errors could be reported.

    Comment

    • PreethiGowri
      New Member
      • Oct 2012
      • 126

      #3
      Code:
      while(rs.next()) {
                     outData.append(rs.getLong(1)).append(":")
      .append(rs.getString(2)).append(":").append(rs.getInt(3))
      .append(":").append(rs.getString(4)).append(":")
      .append(rs.getString(5)).append(":")
      .append(rs.getString(6)).append("$");
                 }
                 outData.append("#");
      /*datatypes in java and mysql

      java mysql
      getString varchar
      getLong Bigint
      getInt int, tinyint */

      the error occurs after this ResultSet block, , i dont know why

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        You can pinpoint it further by putting those rs.getXX calls in separate statements. If it's the bigint column then use try using getBigDecimal.

        Comment

        • PreethiGowri
          New Member
          • Oct 2012
          • 126

          #5
          i tried doing it by sending 25 rows of data per 1 iteration of for loop and it works fine. But when i try to transmit whole set of data its not working, it gives the same notification(Ja va Result:-1073807364).

          Is their any limit for ResultSet?!

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            What do you mean by transmit? Where did you set the limit?

            Comment

            • PreethiGowri
              New Member
              • Oct 2012
              • 126

              #7
              i transmit the accessed data from database to an other system via ethernet.

              i have set the limit here -
              Code:
              String query = "select * from table_name limit "+limit1+",25";
              where, limit1 holds values like 1,26,51 and so on

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Maybe you are keeping the database connections open for too long while doing the transfer? Select the data into a List of results and close your result set and connection then loop through your list transferring the records.

                Comment

                • PreethiGowri
                  New Member
                  • Oct 2012
                  • 126

                  #9
                  I tried that too, without any success :(

                  Comment

                  • r035198x
                    MVP
                    • Sep 2006
                    • 13225

                    #10
                    You now need to create a small but full complete class with code that demonstrates the problem and post it. If the error is database side only like you are suggesting by saying it's affected by the limit then the example code shouldn't need to include the part that transfers the files.

                    Comment

                    • PreethiGowri
                      New Member
                      • Oct 2012
                      • 126

                      #11
                      I have attached the whole working code part causing the problem, please find the attachment.
                      Attached Files

                      Comment

                      • r035198x
                        MVP
                        • Sep 2006
                        • 13225

                        #12
                        No don't attach all the code. Create a small class with code that demonstrates the problem and post that code here using code tags.

                        Comment

                        • PreethiGowri
                          New Member
                          • Oct 2012
                          • 126

                          #13
                          Code:
                          public static String getData(String table) {
                                  Connection con = null;
                                  StringBuilder outData = new StringBuilder();
                                  try {
                                      Class.forName("com.mysql.jdbc.Driver");
                                      String conURL = "jdbc:mysql://localhost/icart";
                                      con = DriverManager.getConnection(conURL,
                           "user", "pswrd");
                                      String query = "select * from " + table + "";
                                      System.out.println(query);
                                      PreparedStatement st = con.prepareStatement(query);
                                      ResultSet rs = st.executeQuery();
                                      outData.append("%");
                                      System.out.println("appending data");
                                      while (rs.next()) {
                                          outData.append(rs.getBigDecimal(1))
                                   .append(":").append(rs.getString(2)).append(":")
                                   .append(rs.getInt(3)).append(":")
                                   .append(rs.getString(4)).append(":")
                                   .append(rs.getString(5)).append(":")
                                   .append(rs.getString(6)).append("$");
                                      }
                                      outData.append("~"); //the code terminates at this line
                                      rs.close();
                          
                                      con.close();
                                      System.out.println(outData);
                                  } catch (ClassNotFoundException ex) {
                                      Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
                                  } catch (SQLException | RuntimeException e) {
                                      JOptionPane.showMessageDialog(null, e);
                                  }
                                  return outData.toString();
                              }
                          Here it is

                          Comment

                          • r035198x
                            MVP
                            • Sep 2006
                            • 13225

                            #14
                            Don't just do
                            Code:
                            } catch (SQLException | RuntimeException e) {
                                        JOptionPane.showMessageDialog(null, e);
                                    }
                            when debugging. Print out the whole stacktrace with e.printStackTra ce();

                            Comment

                            • PreethiGowri
                              New Member
                              • Oct 2012
                              • 126

                              #15
                              i see some errors in log file after printing the StackTraces, i don't understand what they actually mean, kindly help me.

                              Here i attach my IDELog file
                              Attached Files

                              Comment

                              Working...