04-24-2012 11:19 AM
hello and good day ,
please i want to find out if it is ok to use a thread to handle database connections using sqlite , is it ok ? , if i want to retrieve data from an sqlite database do i wrap it up like i would do a network code to retrieve and display results from an sqlite database , any tips would be appreciated thank you.
Solved! Go to Solution.
04-24-2012 01:19 PM
From what I have been doing.
repeat when needed
When you are down with the application and want to close the application
04-24-2012 03:25 PM - edited 04-24-2012 03:26 PM
Just a small note.
When you use the cursor to get a Select statement. The values returned start with 0.
i.e. If I wanted the "column1" value, then I get the row item at 0. "column2" would be at 1 and "column3" would be at 2.
Statement statement = SQLManager.appDB.createStatement("SELECT column1, column2, column3 FROM " + tableName + " WHERE Attribute = ?"); statement.prepare(); statement.bind(1, attribute); Cursor cursor = statement.getCursor(); Row row; cursor.first(); //Use first cursor spot row = cursor.getRow(); thisValue = row.getString(0); statement.close(); cursor.close();
I've been banging my head on this all day. Good thing for break points.