sqlite

createEditableCopyOfDatabaseIfNeeded create an empty copy of db!!!

Hi! I'm using the "famous" :) function createEditableCopyOfDatabaseIfNeeded for create an editable copy of my db in an iphone app.. The function copy the original db in the documents directory only if there isn't already a copy of the db.. pretty simple.. but now I'm in trouble because I don't know why but with SDK 3.2.3 in iOS 4.1 the f...

Safe read-only sqlite3 database

I want to give my website users arbitrary read-only access to an SQLite3 database, without letting them write to the database or do any other damage. How? Making the db file read-only helps a little, but commands like "ATTACH", ".load" and ".output" allow people to read/write other files, which may not be protected. Of course, if I kne...

Javascript Object -> SQL, in Javascript

I have a simple client-side Sqlite database (via. Google Gears) I want to use for persistence of the contents of a javascript object's properties (not methods). I don't really care about normalization since it has lots of potentially disparate fields (primitive types, arrays, objects) that would thwart normalization anyway. What would ...

Images in iPhone app

Hi, I am creating a multilayered iPhone app using a navigation controller and the app includes a lot of images in every layer. I was wondering if it is a good idea to use a SQLite database to store all the images and extract them to the page when needed or should i just add all the images to the resources folder and pull them into the ap...

url not getting inserted in SQLite3 database

Hi All, i'm trying to insert the url links in the SQLite3 database but its crashing does any one have any idea ... y its happening ? if i statically trying to insert any url, it works but dynamically when i get urls of navigated web pages.... they do not insert.... please suggest me how to make it work. I'm using SDK 3.2 this is my i...

Combining Two SQLite Stores Into One

Say I have two SQLite files in my application documents directory. How would I go about combining the two together and saving them as a single file that contained all the information from both? Do I literally have to create two persistent store coordinators and manually coordinate the process between the two, or is there some more effici...

How should I design the tables to store tags in a database?

"question_id": 58640 "tags": ["polls", "fun", "quotes"] "title": "Great programming quotes" "question_id": 184618 "tags": ["polls", "fun", "comment"] "title": "What is the best comment in source code you have ever encountered?" "question_id": 3734102 "tags": ["c++", "linux", "exit-code"] "title": "Why cant' I return bigger values from ma...

SQLite triggers in Android ?

Hi all I want to forece a foreign key constarint on a table in an Android application. I've searched that this can be done by using triggers: I did it like this: db.execSQL("CREATE TRIGGER dept_id_trigger22+" + " AFTER INSERT "+ " OF EmployeeName ON Employees"+ " BEGIN"+ ...

Query the row which with the maximum value on "cont" column

Hey, I'm trying to query the words which have the maximul values in the cont columns. Ex: if the word "test1" has the value 5 in cont, and "test2" has 2, "test1" will be shown in first position. got it? so. Im trying to do it but it returns the following error: 09-18 22:24:04.072: ERROR/AndroidRuntime(435): Caused by: android.database....

NHibernate with Windows Application

Looking through StackOverflow this question seems to be asked a lot, but I have tried everything listed and can't seem to get any of them to work. I currently trying to use NHibernate in a Windows Application written in C# on .NET 4.0. My currently platform target is x86, and I have confirmed that I'm using the x86 System.Data.SQLite, ...

iPhone: Parsing large xml files and adding the content to the sqlite db

I'm using libxml2′s DOM parser in my iPhone to parse a XML file with 100'000 lines and put the content into a db! This process takes several minutes to complete! Too much to be user friendly! Im looking now for any hints on how to make this process more efficient! I guess, that the biggest part of the time gets lost writing the data into...

How expensive sqlite3.connect and close in SQLite?

I use connect() and cursor() for using SQLite self.connector = sqlite3.connect(self.dbFile) self.cursor = self.connector.cursor() And close() for stop using it. self.cursor.close() How expensive (in terms of processing time) are they? Is it so expensive that it's necessary to use it only absolutely necessary? Or, is it just OK to...

Failed to read blob data from sqlite

i store blob data with php like this $this->_db->exec"CREATE TABLE media (url TEXT, content BLOB)"); $fp = fopen($encoded['path'], 'rb'); $sql = "INSERT INTO media (url, content) VALUES (?, ?)"; $stmt = $this->_db->prepare($sql); $stmt->bindValue(1, $encoded['url'], PDO::PARAM_STR); $stmt->bindValue(2, $fp, PDO::PARAM_LOB); $stmt->exec...

webapp folder structure for securing plaintext passwords and sqlite database

Im building a simple web app in Python using web.py - and was wondering what best practices are in terms of securing the application. I had two main questions at this stage: I want the application to be able to send email - its not hosted on GAE, but I thought a simple solutions might be to write / find a s script tha...

SQLite slowing down after millions of rows, how to speed up?

I have a single table in SQLite that essentially has the following: id : integer (primary key) name: text timestamp: text data1: integer data2: integer ... data6: integer I need to filter by name and timestamp, so I have the (name, timestamp) index set up. At 100,000,000 rows, SQLite crawls at querying. Understand the index reduces t...

Android database question, need advice and suggestions

I currently facing problem where user have the choice to enter several working experience, where every working experience include several details (company name, duration, roles etc) I don't know how should I store it since users have the freedom to add as many working experience as they have. I have a table as below private static fina...

SQL data is not stored on iphone

Hey, I have been following this tutorial on embedding SQLITE in my iPhone App. The thing is, when adding a new object into the SQL DB everything is fine, but, as soon as i change anything (e.g.) the name of the entry, and then restart my app, the new name is not saved. Since I couldn't find a similar issue nor have I been working with ...

How to remove the error "Cant find PInvoke DLL SQLite.interop.dll"

I am developing windows mobile application. I am using the SQLlite database. I am using the following code to connect to this database as follows SQLiteConnection cn = new SQLiteConnection(); SQLiteDataReader SQLiteDR; cn.ConnectionString = @"Data Source=F:\CompNetDB.db3"; ...

SQLite to ListActivity

Hello. I have this code in my DataBase Helper: public ArrayList<ArrayList<Object>> getAllRowsAsArrays() { // create an ArrayList that will hold all of the data collected from // the database. ArrayList<ArrayList<Object>> dataArrays = new ArrayList<ArrayList<Object>>(); // this is a database call that creates a "cursor" ...

Creating a nested set with sqlite and Objective-c

I was struggling with nested sets, specifically building one on the iPhone using sqlite. I found a handy script that I then adapted from PHP. It basically sets the left and right values based on parent ids. So you need a table where each entry has an 'id' and a 'pid' as well as 'lft' and 'rgt'. I find it easy to map the ids to their re...