2011-04-20 12:10:34 -04:00
|
|
|
package hu.blint.ssldroid.db;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
|
|
import android.database.sqlite.SQLiteOpenHelper;
|
|
|
|
|
|
|
|
public class SSLDroidDbHelper extends SQLiteOpenHelper {
|
2011-05-04 15:31:26 -04:00
|
|
|
private static final String DATABASE_NAME = "applicationdata";
|
|
|
|
|
|
|
|
private static final int DATABASE_VERSION = 1;
|
|
|
|
|
|
|
|
// Database creation sql statement
|
|
|
|
private static final String DATABASE_CREATE = "create table tunnels (_id integer primary key autoincrement, "
|
|
|
|
+ "name text not null, localport integer not null, remotehost text not null, "
|
|
|
|
+ "remoteport integer not null, pkcsfile text not null, pkcspass text );";
|
|
|
|
|
|
|
|
public SSLDroidDbHelper(Context context) {
|
|
|
|
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Method is called during creation of the database
|
|
|
|
@Override
|
|
|
|
public void onCreate(SQLiteDatabase database) {
|
|
|
|
database.execSQL(DATABASE_CREATE);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Method is called during an update of the database, e.g. if you increase
|
|
|
|
// the database version
|
|
|
|
@Override
|
|
|
|
public void onUpgrade(SQLiteDatabase database, int oldVersion,
|
|
|
|
int newVersion) {
|
|
|
|
/* Log.w(SSLDroidDbHelper.class.getName(),
|
|
|
|
"Upgrading database from version " + oldVersion + " to "
|
|
|
|
+ newVersion + ", which will destroy all old data");
|
|
|
|
database.execSQL("DROP TABLE IF EXISTS todo");
|
|
|
|
onCreate(database); */
|
|
|
|
}
|
2011-04-20 12:10:34 -04:00
|
|
|
}
|
|
|
|
|