Skip to content
Advertisement

Tag: sqlite

How do I use SQLite in android?

I’ve founde already a few answers to this topic (for example this), but it is not working. I only get the warning, that it cannot resolve the method ‘openOrCreateDatabase(java.lang.String, int, null)’. Here is my sourcecode: Answer SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with built in SQLite database

ArrayOutOfBoundsException on PreparedStatement

I’m at a loss here, can anyone see what’s wrong with this code? I’m using sqlite with this driver: https://bitbucket.org/xerial/sqlite-jdbc/downloads edit: fixed my initial error but have a similar one I get an exception at this line: stmt.setLong(1, tweet.getID()); The exception: This is how I created the table Answer As per the docs at http://docs.oracle.com/javase/7/docs/api/java/sql/PreparedStatement.html#setLong(int,%20long)

RealmObject AND Parcelable

I’m new to Realm for Android so I’m not sure I’m approaching this the right way. I have a class which looks like this: The problem is the Parcelable interface contains methods like describeContents() writeToParcel() and RealmObjects aren’t supposed to have methods other than getters and setters: So my question is: How can I make these two work together? Is

SQLite 64bit integers recognized as ints in jooq

I have an SQLite database that I am using with jOOQ. When I use jOOQ’s code generation tool, it builds all of the table and record classes as expected. However, all of the SQLite INTEGER columns turn into java.lang.Integer fields in the generated code. The problem is that SQLite INTEGER’s can store up to a 64 bit signed integer, where

Sqlite4java on Raspberry Pi

I want to use my java project on Raspberry Pi. This code depends on sqlite4java which uses native implementations for many platforms including arm processors link. The problem is that java can’t load required sqlite wrapper for arm processor. I was doing the follows: Copied all version (tried one by one) of precompiled libraries (libsqlite4java-linux-armv5te.so, libsqlite4java-linux-armv7a.so, libsqlite4java-linux-arm.so) which I renamed

Read data from SQLite where column name contains spaces

I am having a coulmn name called “condition name” (.sql file has been generated from server) But in android I am getting following exception while reading data from that table. 12-24 14:34:00.870: W/System.err(269): android.database.sqlite.SQLiteException: no such column: condition: , while compiling: SELECT condition, category, subcategory,condition name, local path, remote path, title, content_type FROM library WHERE category = ? Its not

data from sqlite into ArrayList

i am using code this blog to have a draggable list. This tutorial is using a custom DragNDropAdapter that takes the content as an ArrayList. In my listActivity i query a table with returned column name.It has 11 values inserted. i tried to convert it to ArrayList from String[] with many ways such as : or what i get is

How to join tables using sqlite in android

I am trying to find out how to do a simple table join on my two tables using a sqlite database in an android application. Is the simplest way to use CursorJoiner or is there any easier way? Answer In the implementation of SQLiteDatabase and SQLiteQueryBuilder you will see that it is possible to pass the tables you want to

Advertisement