1
0
mirror of https://github.com/moparisthebest/SSLDroid synced 2024-11-27 11:22:20 -05:00
SSLDroid/src/hu/blint/ssldroid/db/SSLDroidDbHelper.java

40 lines
1.4 KiB
Java
Raw Normal View History

package hu.blint.ssldroid.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class SSLDroidDbHelper extends SQLiteOpenHelper {
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); */
}
}