Sam-In-TechValens
Sam-In-TechValens

Reputation: 2519

Sqlite database exception: file is encrypted or is not a database in blackberry?

I am working on a firm application in which I need to create a local database on my device.

I create my local database through create statement[ It works well]

Then I use that file and perform insert operation through fire-fox sqlite plugin, I need to insert aprox 2000 rows at a time so I can not use code. I just run insert manually through sqlite plugin in fir-fox.

After that I just use that file in my place of my local database.

When I run select query through my code, It show Exception:java.lang.Exception: Exception: In create or prepare statement in DBnet.rim.device.api.database.DatabaseException: SELECT distinct productline FROM T_Electrical ORDER BY productline: file is encrypted or is not a database

Upvotes: 2

Views: 5028

Answers (3)

Romesh
Romesh

Reputation: 2274

For me it was a simple thing. One password was set to that db. I just used it and prolem got solved.

Upvotes: 0

Sam-In-TechValens
Sam-In-TechValens

Reputation: 2519

I got the solution of this problem, I was doing a silly mistake by creating a file manually by right click in my RES folder, that is not correct. We need to create the database completely from SQlite plugin, then it will work fine. "Create data base from SQLITE(FIle too) and perform insertion operation from SQLITE, then it will work fine"

This is very rare problem, but i think it might be helpful for someone like me....!:)

Upvotes: 3

Richard
Richard

Reputation: 8920

You should check to see if there is a version problem between the SQLite used by your Firefox installation and that on the BlackBerry. I think I had the same error when I tried to build a database file with SQLite version 2.

You also shouldn't need to create the database file on the device. To create large tables I use a Ubuntu machine and the sqlite3 command line. Create the file, create the tables, insert the data and build indexes. Then I just copy the file onto the device in the proper directory.

Upvotes: 1

Related Questions