Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8259719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:55:46+00:00 2026-06-08T02:55:46+00:00

I have an database with 2 tables in it. In that in 1 table

  • 0

I have an database with 2 tables in it. In that in 1 table I have id group 2 columns. Now I want is I have to retrieve the group data in the table.

My retrieving place:

db.open();
     for(int i=1;i<=5;i++)
     {       
     if(i==1)
         group1=db.getspintitle(1);
     if(i==2)
         group2=db.getspintitle(2);
     if(i==3)
         group3=db.getspintitle(3);
     if(i==4)
         group4=db.getspintitle(4);
     if(i==5)
         group5=db.getspintitle(5);     
     }

My database code:

public String getspintitle(int rowId)throws SQLException
{   
    String sumtotal="";
    Cursor cursor1 = db.rawQuery(
             "SELECT spin from spinner WHERE _id=rowId", null);  
//   sumtotal=cursor1.toString();   
//   cursor1.close();       
    for(int i=rowId;i<cursor1.getCount();i++)
    {
    if (cursor1 != null && cursor1.getCount() > 0)
    {          cursor1.moveToNext();         
    sumtotal= cursor1.getString(i);          
    cursor1.close();    
    }   
    }
    return sumtotal;        

//  String spin="SELECT spin from spinner WHERE _id='rowId' ";
//  return spin;
}

My logcat is:

07-18 14:12:01.890: E/CursorWindow(27405): Bad request for field slot 0,1. numRows = 6, numColumns = 1
07-18 14:12:01.898: D/AndroidRuntime(27405): Shutting down VM
07-18 14:12:01.898: W/dalvikvm(27405): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
07-18 14:12:01.962: E/AndroidRuntime(27405): Uncaught handler: thread main exiting due to uncaught exception
07-18 14:12:02.000: E/AndroidRuntime(27405): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.budget1/com.budget1.Report}: java.lang.IllegalStateException: get field slot from row 0 col 1 failed
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.os.Looper.loop(Looper.java:123)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.app.ActivityThread.main(ActivityThread.java:4363)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at java.lang.reflect.Method.invokeNative(Native Method)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at java.lang.reflect.Method.invoke(Method.java:521)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at dalvik.system.NativeStart.main(Native Method)
07-18 14:12:02.000: E/AndroidRuntime(27405): Caused by: java.lang.IllegalStateException: get field slot from row 0 col 1 failed
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.database.CursorWindow.getString_native(Native Method)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.database.CursorWindow.getString(CursorWindow.java:329)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:49)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at com.budget1.DBadapter.getspintitle(DBadapter.java:208)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at com.budget1.Report.onCreate(Report.java:65)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-18 14:12:02.000: E/AndroidRuntime(27405):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
07-18 14:12:02.000: E/AndroidRuntime(27405):    ... 11 more
07-18 14:12:02.078: I/dalvikvm(27405): threadid=7: reacting to signal 3
07-18 14:12:02.198: I/dalvikvm(27405): Wrote stack trace to '/data/anr/traces.txt'
07-18 14:17:02.150: I/Process(27405): Sending signal. PID: 27405 SIG: 9
07-18 14:17:04.198: I/System.out(6293): subbu

Where I am going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:55:47+00:00Added an answer on June 8, 2026 at 2:55 am
    Cursor cursor1 = db.rawQuery("SELECT spin from spinner WHERE _id="+rowId, null);  
                                                                      ^^^^^^^
    sumtotal= cursor1.getString(0);// zero instead of i
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Yahoo! Group that has its own Database tables for various reasons.
I have a database two tables and a linking table that I need a
Basically I have a database with two tables, that is, Updates table and Images
I have a very simple database table that joins two other tables in a
I have a database that has node & nodetype tables. Nodes table NodeID ParentNodeID
I have an oracle 10g database that has 2 tables: a REBATES table, and
MYSQL Database: I have a table of data that I need to put into
I have several database tables that just contain a single column and very few
I have a database table that has a Unique Key constraint defined to avoid
I have a database table that is a dictionary of defined terms -- key,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.