Dynamic Database Backup For Certain Tables
I need to backup just some of the tables in my main database. The other tables are reference and are static so do not need to be backed up. I have created a new blank DB that is on
Solution 1:
I wrote a class to handle this. Yes my DB is at least 95% reference...
Here is the guts of the code:
Cursorc= DbBak.rawQuery(Sql, null);
String Cn[] = c.getColumnNames();
if (c != null ) {
if (c.moveToFirst()) {
do {
for ( x=0; x< c.getColumnCount(); x++)
{
newRow.put(Cn[x].toString(), c.getString(x));
}
Db.insert(TableName, null, newRow);
}while (c.moveToNext());
Post a Comment for "Dynamic Database Backup For Certain Tables"