public class DatabaseHelper extends SQLiteOpenHelper{

public DatabaseHelper(Context context, String name, CursorFactory
factory,
int version) {
super(context, name, null, version);
// TODO Auto-generated constructor stub
init();
}

@Override public void onCreate(SQLiteDatabase db) {}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {}


private void init()
{
SQLiteDatabase Rdb = getReadableDatabase();
String Rsql = "select count(*) from sqlite_master where name='good'
and type='U'";

try { Rdb.execSQL(Rsql)
catch (SQLException Re) {
Log.e("ERROR", Re.toString());
SQLiteDatabase Wdb = getWritableDatabase();
String Wsql = "create table good(" + "stud_no text not null, "
+ "stud_name text );";
try { Wdb.execSQL(Wsql); }
catch (SQLException We) {
Log.e("ERROR", We.toString());
}
close();
}
}
}

if the table created, restart again the check str is fail

the Rsql right or not ??

please help me !
thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to