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

  • SEARCH
  • Home
  • 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 4332794
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:18:17+00:00 2026-05-21T10:18:17+00:00

When i am calling the my already created data base in SQ lite.It giving

  • 0

When i am calling the my already created data base in SQ lite.It giving the Run time Exception that data base is calling recursively.but every time the data base use is over i closed it.
what is going wrong with it?i am using eclipse and developing program in android.

i creating the object of helper class(In which i created the database).and and then
using SQliteDatabase db=hc.getWritebleDatabase();
Exception is in the above line

hc=helperclass object

answer me..because on Google i didn’t get any related answer.

code getting Exception:::
i have already a data base class named HelperClass .its had table named New_User

public void check_pass()
{
boolean flag=true;
private HelperClass hc = new HelperClass(this);
SQLiteDatabase db;  
try{ db=hc.getWritableDatabase();}

catch(Exception ex)
         {
             Toast.makeText(this,""+ex.getMessage(),Toast.LENGTH_SHORT).show();
         }
    cur=db.query("New_User",null,null,null,null,null,null);
    cur.moveToFirst();
  do{
   if(cur.getString(0).equalsIgnoreCase(edittext_name.getText().toString())&&cur.getString(3).equals(edittext_pass.getText().toString())){
    flag=false;

    //dialog = ProgressDialog.show(MainActivity.this,"","Please wait for few seconds...", true);
    //dialog.setCancelable(true); 
    //dialog.show();
    Intent intent1=new Intent(this,Friends.class);
    startActivity(intent1);
     }
  cur.moveToNext();
   }  while(cur.moveToNext());
    if(flag==true){
       Toast.makeText(this,"Incorecct user name or password",Toast.LENGTH_SHORT).show();   
    }

data base Creation:

public class HelperClass extends SQLiteOpenHelper {
    public final static String Db_name="employee.db";
    protected final static int Db_version=1;
    protected final static String Ename="Ename";
    protected final static String Email="Email";
    protected final static String Epass="Epass";
    protected final static String Eabout="Eabout";
    protected final static String Egender="Egender";
    protected final static String Ehob1="Ehob1";
    protected final static String Ehob2="Ehob2";
    protected final static String Ehob3="Ehob3";
    protected final static String Ehob4="Ehob4";


    public HelperClass(Context context){   
    super(context,Db_name,null,Db_version);
    }

    public void onCreate(SQLiteDatabase db1){
        db1=this.getWritableDatabase();
        String sql= "CREATE TABLE New_User("+Ename +" text not null," +
        ""+ Egender +" text not null," +
        ""+ Email +" text not null primary key," +
        "" +Epass+" text not null,"+
        ""+ Eabout +" text not null,"+
        ""+ Ehob1 +" text,"+ Ehob2 +" text,"+ Ehob3 +" text,"+ Ehob4 +" text);";
       db1.execSQL(sql);

    }
  • 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-05-21T10:18:18+00:00Added an answer on May 21, 2026 at 10:18 am

    Remove this line:

    db1=this.getWritableDatabase();
    

    So your database onCreate method should be:

    public void onCreate(SQLiteDatabase db1){
        String sql= "CREATE TABLE New_User("+Ename +" text not null," +
        ""+ Egender +" text not null," +
        ""+ Email +" text not null primary key," +
        "" +Epass+" text not null,"+
        ""+ Eabout +" text not null,"+
        ""+ Ehob1 +" text,"+ Ehob2 +" text,"+ Ehob3 +" text,"+ Ehob4 +" text);";
       db1.execSQL(sql);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Calling image = Image.open(data) image.thumbnail((36,36), Image.NEAREST) will maintain the aspect ratio. But I need
I have a java application that streams raw data and draws real time plots
I need to save my data by calling a method I already have when
I've created a WCF service which I intend to use when sending data from
How can I retrieve an existing ShiroRole that I've already created and stored in
ERROR: JSpell is already attached, or jspellInit has not been called before calling jspellCheck.
Calling Html.RenderPartial(~/Views/Payments/MyControl.ascx); from a view works if MyControl.ascx is a control that directly inherits
Calling the ajax called URL works well without ajax eg. http://localhost/ci/controller/method/param_value . But using
When calling functions that always throw from a function returning a value, the compiler
i am creating an app that needs a database. i created it using sqlite

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.