Note that there are some explanatory texts on larger screens.

plurals
  1. POan android data base problem
    text
    copied!<p>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.</p> <p>i creating the object of helper class(In which i created the database).and and then using <code>SQliteDatabase db=hc.getWritebleDatabase();</code> Exception is in the above line</p> <pre><code>hc=helperclass object </code></pre> <p>answer me..because on Google i didn't get any related answer.</p> <p>code getting Exception::: i have already a data base class named HelperClass .its had table named New_User</p> <pre><code>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())&amp;&amp;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(); } </code></pre> <p>data base Creation:</p> <pre><code>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); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload