-1

データベースにいくつかのテーブルがあります。自分のデータを自分のデータベース テーブルにアップロードできます。データを取得しようとすると、このようなエラーが発生しました。

  11-05 12:34:09.538: INFO/System.out(1805): div value <0
  11-05 12:34:09.548: INFO/System.out(1805): values going to inserted------------------>
  11-05 12:34:09.560: INFO/System.out(1805): values updatred------------------>
  11-05 12:34:09.568: INFO/System.out(1805): values selected after updated------------>
  11-05 12:34:09.568: INFO/System.out(1805): count after updated------>12
  11-05 12:34:09.578: INFO/System.out(1805): new title---->RevenuePredictionData
  11-05 12:34:09.578: INFO/System.out(1805): new month---->Oct
  11-05 12:34:09.578: INFO/System.out(1805): new actual---->5006000.0
  11-05 12:34:09.578: INFO/System.out(1805): new plan---->6405750.0
  11-05 12:34:09.578: INFO/System.out(1805): new year_over---->-1399750.0
  11-05 12:34:09.588: INFO/System.out(1805): new year_var---->-27.96
  11-05 12:34:09.588: INFO/System.out(1805): database value-----0
  11-05 12:34:09.588: INFO/System.out(1805): RevenuePredictionData
  11-05 12:34:09.588: INFO/System.out(1805): database value-----0
  11-05 12:34:09.588: INFO/System.out(1805): Oct
  11-05 12:34:09.588: ERROR/CursorWindow(1805): Bad request for field slot 0,9. numRows = 12, numColumns = 6
  11-05 12:34:09.598: DEBUG/AndroidRuntime(1805): Shutting down VM
  11-05 12:34:09.598: WARN/dalvikvm(1805): threadid=1: thread exiting with uncaught exception (group=0x40015560)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805): FATAL EXCEPTION: main
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805): java.lang.IllegalStateException: get field slot from row 0 col 9 failed
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.database.CursorWindow.getDouble_native(Native Method)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.database.CursorWindow.getDouble(CursorWindow.java:399)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.database.AbstractWindowedCursor.getDouble(AbstractWindowedCursor.java:138)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at com.exale.newfinace.Income$4.onProgressChanged(Income.java:1026)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.widget.SeekBar.onProgressRefresh(SeekBar.java:89)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:507)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.widget.ProgressBar.refreshProgress(ProgressBar.java:516)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.widget.ProgressBar.setProgress(ProgressBar.java:565)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.widget.AbsSeekBar.trackTouchEvent(AbsSeekBar.java:337)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.widget.AbsSeekBar.onTouchEvent(AbsSeekBar.java:292)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.View.dispatchTouchEvent(View.java:3885)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.os.Handler.dispatchMessage(Handler.java:99)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at  android.os.Looper.loop(Looper.java:123)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at java.lang.reflect.Method.invokeNative(Native Method)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at java.lang.reflect.Method.invoke(Method.java:507)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  11-05 12:34:09.618: ERROR/AndroidRuntime(1805):     at dalvik.system.NativeStart.main(Native Method)
  11-05 12:34:11.528: ERROR/InputDispatcher(61): channel '406bdc58 com.exale.newfinace/com.exale.newfinace.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
  11-05 12:34:11.528: ERROR/InputDispatcher(61): channel '406bdc58 com.exale.newfinace/com.exale.newfinace.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
  11-05 12:34:11.608: ERROR/InputDispatcher(61): Received spurious receive callback for unknown input channel.  fd=154, events=0x8
  11-05 12:34:11.608: ERROR/InputDispatcher(61): Received spurious receive callback for unknown input channel.  fd=166, events=0x8

どうすればこれを解決できますか? どんな体でも教えてもらえますか?前もって感謝します 。

4

1 に答える 1

1

このエラーは、データベース値の選択プロセスで愚かな間違いが発生した場合に発生します。このように列インデックスを割り当てます

        // Do some process

     int Column2 = c.getColumnIndex("Month");
     if (c.moveToFirst())
     {                       
        for (int i = 0; i < columncount; i++)
    { 
           Log.i("data count", ""+i);
       my_title[i] = c.getString(Column2);
           Log.i("month.....",""+my_month[i]);
           c.moveToNext();
        }
     } 

これの代わりに、このように与えると、フィールドスロットエラーの不正なリクエストが発生します。

     // Do some process

      int Column2 = c.getColumnIndex("Month");
      if (c.moveToFirst())
      {                       
         for (int i = 0; i < columncount; i++)
          { 
             Log.i("data count", ""+i);
             my_title[i] = c.getString(2);
             Log.i("momth.....",""+my_month[i]);
             c.moveToNext();
          }
      } 
于 2012-11-06T04:42:49.320 に答える