mirror of
https://github.com/moparisthebest/SSLDroid
synced 2024-11-23 17:32:15 -05:00
40 lines
1.3 KiB
Java
40 lines
1.3 KiB
Java
|
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); */
|
||
|
}
|
||
|
}
|
||
|
|