KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I know that subject was disscussed before. But i cant find solution to my problem so im going to ask it one more time. I have problem creating database. Ive copied implementation of SQLiteOpenHelper: public class DBCreator extends SQLiteOpenHelper { private static final String DATABASE_NAME = "servision.db"; private static final int DATABASE_VERSION = 1; private static final String INFO_TABLE ="create table INFO(key text,value text);"; public static final String GATEWAYS_TABLE = "GATEWAYS"; // Table name public static final String TABLE = "events"; // Columns public static final String TIME = "time"; public static final String TITLE = "title"; public DBCreator(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { try { String gatewaytablescript ="create table" +GATEWAYS_TABLE+"(" + "id int primary key, " + "host text not null," + "port int not null," + "username text," + "password text,"+ "useproxy int," + "proxyHost text," + "proxyPort port," + "desc text," + "secondaryip text," + "secondaryport int," + "timezone int," + "encryption int," + "customkey text" + ");"; Log.d("DBCreator", "Creating " + GATEWAYS_TABLE + "table"); db.execSQL(gatewaytablescript); String infotablescript ="create table " + INFO_TABLE + "(key text,value text);"; Log.d("DBCreator", "Creating " + INFO_TABLE + "table"); db.execSQL(infotablescript); } catch(SQLException ex) { Log.d("DBCreator", "onCreate exception " +ex.getMessage()); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, in
Tags (comma-separated)
Save Edits
Cancel