HELP: Recommendation for Initial Load of Large Data SQLite D

Put your problem here if it does not fit any of the other categories.

HELP: Recommendation for Initial Load of Large Data SQLite D

Postby gilgantic » Sat Mar 15, 2008 7:55 pm

Hi All,

I am stumped on how to load a large amount of data at the initial creation of my database. I am using the embedded SQLite to build about 4 tables, where 3 tables are on avg 6000 rows of data. I read in from a text file and the parse each line into String[] based on delimeters, so I can create/execute INSERT statements. Once I get the database loaded my queries and updates work like champ (even for slow PC), but the initial load is a killer. I have to wait 30mins - 1hr before all data is loaded. Thats not good!

Here is an example of I read in ...
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. InputStream inputStream = ctx.getResources().openRawResource(R.raw.item_list);
  3.  
  4. BufferedReader br = new BufferedReader(new InputStreamReader(inputStream), 1016688); //1016688 max
  5.  
  6. while ( (buffer = br.readLine()) != null)
  7.  
  8.                         {
  9.  
  10.                                 String[] s = buffer.split("\\^");
  11.  
  12.                                 // Build   INSERT...INTO statements and execute them.
  13.  
  14.                         }
  15.  
  16.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4

Is it possible to load a prebuilt SomeDB.db file into an Android application? ... or something ...
If possible, my goal is to avoid hitting a database from an external location via web application server, etc., at least for the initial load.

Thanks!
gilgantic
gilgantic
Freshman
Freshman
 
Posts: 6
Joined: Sun Feb 24, 2008 11:08 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 18 guests