SQLite Database

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

SQLite Database

Postby gunaztar » Tue Feb 26, 2008 5:36 am

I am working with SqLite database using m5 version. The following line in thee code showing error. Cannot find symbol.. Wat to do...
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  Cursor c;
  2.  
  3.         c = myDB.query("SELECT FirstName,Age FROM " + MY_DATABASE_TABLE ,null);
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
gunaztar
Junior Developer
Junior Developer
 
Posts: 18
Joined: Wed Feb 20, 2008 12:40 pm

Top

Postby snowtiger » Tue Feb 26, 2008 5:17 pm

Here u can have a look at a complete SQLite example:

http://developer.db4o.com/ProjectSpaces ... rd_Manager

API sais:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. query(Uri, String[], String, String[], String) //which returns data to the caller
Parsed in 0.081 seconds, using GeSHi 1.0.8.4


Can't see this Strings in ur code snippet.
snowtiger
Developer
Developer
 
Posts: 34
Joined: Fri Dec 21, 2007 10:44 am

Postby plusminus » Tue Feb 26, 2008 7:29 pm

Hello gunaztar,

in m5 you have the possibility snowtiger, but also still the old style is possible.

The function now is called "Cursor android.database.sqlite.SQLiteDatabase.rawQuery(String sql, String[] selectionArgs)".

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby living_sword » Wed Feb 27, 2008 3:43 am

try this,

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. String[] myCols = {"FirstName","Age"};
  2.  
  3.  
  4.  
  5. Cursor c = myDB.query(true, MY_DATABASE_TABLE, myCols, null, null, null, null, null);
Parsed in 0.069 seconds, using GeSHi 1.0.8.4



i've used this form of query,

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public Cursor query(boolean distinct, String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy)
Parsed in 0.038 seconds, using GeSHi 1.0.8.4
Image
living_sword
Junior Developer
Junior Developer
 
Posts: 23
Joined: Fri Nov 23, 2007 4:44 am

Postby chitgoks » Tue Mar 11, 2008 7:55 am

hey, can an existing sqlite db be included in your source and compile time? i want to populate data to the db before the person can actually use my app :D
Website/Java Games: http://www.chitgoks.com
Blogs:
http://tech.chitgoks.com
http://wuhtevah.chitgoks.com
http://disneyusa.blogspot.com
chitgoks
Developer
Developer
 
Posts: 36
Joined: Tue Mar 11, 2008 3:06 am

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 8 guests