Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Utente
Posts: 13
Registered: ‎01-21-2013
My Device: BB 10
Accepted Solution

Read an external .sqlite file in WebWorks

Hello!

 

I'm developing an application for BB10; I have a .sqlite file generated by a software and I want to make some queries on it.

 

 

I've read that I can't rely on the HTML5 Database because it doesn't allows you to operate on an arbitrary .sqlite file, but only on the ones integrated in webworks.  Is that correct?

 

Is there any way to read data from my .sqlite file in WebWorks ?

 

Please use plain text.
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: Read an external .sqlite file in WebWorks

Yes, this is not a WebWorks restriction so much as a security restriction itself imposed by Browser based environments. The webview will not allow you to load an arbritray sqlite. Or at least AFAIK.

 

Simplest method may be to do the following:

 

1. Bundle or load the database as a database drop of SQL commands.

2. Loop over the loaded file and execute the commands against the WebSQLite database inserting and creating all tables that you need at load/runtime.

3. Execute any queries that you would like to have to get at your data.

 

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.