Reputation: 2161
I am trying to create a database in the device storage of a BlackBerry simulator. In the 9500 simulator, the database is created successfully but creating a table results in a "File System error" message. On the 9700 simulator, the database fails at the creation step.
Is there a single code sequence which will create a database for all simulators?
I have written the following code:
uri = URI.create("file:///store/home/user/Databases/xtc.db");
xtcDB = DatabaseFactory.open(uri);
createTblQurey.append("CREATE TABLE MESSENGER_USERS");
createTblQurey.append("(");
createTblQurey.append("USERID INTEGER PRIMARY KEY,");
createTblQurey.append("USERNAME TEXT NOT NULL,");
createTblQurey.append("DISPLAYNAME TEXT NOT NULL,");
createTblQurey.append("ISREGISTERED CHARACTER DEFAULT 'N'");
createTblQurey.append(")");
stmt = xtcDB.createStatement(createTblQurey.toString());
stmt.prepare();
stmt.execute();
Debugger.debug(UrlInfo.workflow_File,"MESSENGER_USERS table created successfully...!!!");
Upvotes: 2
Views: 1687
Reputation: 4116
Only following list of BB devices supports SQLite database in device memory that has at least 1 GB of eMMC memory.
Blackberry Bold 9000 Torch 9800 BlackBerry Storm 9500 BlackBerry Storm 2 9550 Blackberry Storm 2 9520
That is the reason why you got error.
Upvotes: 2