Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Android
SQLLite issue
Aris Doxakis
Ranch Hand
Posts: 136
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello,
i have the bellow code that gets all rows from a sqllite table, but no rows are returned and no errors are been thrown.
public ArrayList<Boat> getBoats() { ArrayList<Boat> lstBoat = new ArrayList<Boat>(); try { Cursor mCursor = database.query(true, "Boats", new String[] {"BID","FName","LName","Mobile","ADT","Address","BoatNumb","BoatName","LastDateIn"}, null, null, null, null, null, null); //Cursor mCursor = database.rawQuery("SELECT PID,Pilar,Descr,LastPower,LastWater,isVacant,PosName,PowerMeterNumb,WaterMeterNumb from Positions", null); mCursor.moveToFirst(); while (mCursor.isAfterLast() == false) { Boat boat = new Boat(); boat.setid(mCursor.getInt(0)); boat.setFName(mCursor.getString(1)); boat.setLName(mCursor.getString(2)); boat.setMobile(mCursor.getString(3)); boat.setADT(mCursor.getString(4)); boat.setAddress(mCursor.getString(5)); boat.setBoatNumb(mCursor.getString(6)); boat.setBoatName(mCursor.getString(7)); boat.setLastDateIn(mCursor.getString(8)); lstBoat.add(boat); } Log.d("items boat",String.valueOf(mCursor.getCount())); return lstBoat; } catch (Exception ex) { Log.d("error retrieving Boats:",ex.getMessage().toString()); return null; } }
thanks in advance.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to retrieve metadata in ibatis
listview not clickable
Resultset from Action class to JSP ?
Need help to convert from Con List to Link List
selectOneMenu from database
More...