• 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:

This return this.editStmt.execute(); // gives error , how to code in Android/sqlite?

 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This
return this.editStmt.execute(); // gives error , how to code in Android/sqlite?

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How many times has it been by now that you've been asked to provide exact error messages and stack traces for the problems you post about? TellTheDetails
 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if in
return this.editStmt.execute();
remove return no error, if exist is about returned void result rather long... well ,
anyway.. execute(); is correct command to execute edit/update?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first problem I see is that your edit method returns a long yet the method whose result you are trying to return is void.

I recommend that you look at the JavaDoc for SQLiteStatement found here: http://developer.android.com/reference/android/database/sqlite/SQLiteStatement.html

In it, you will find that execute returns a void, not a long.

Perry Hoekstra
 
Perry Hoekstra
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once you get your code straightened out, I would highly recommend reading: http://developer.android.com/guide/topics/data/data-storage.html#db

Then you can take a look at: http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html which will give you a list of the standard methods you can execute against your database.

In your case, execute is a JDBC method on the Statement object (http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Statement.html).

That is not to say that you cannot use JDBC against a SQLite database, you just need to make sure you have a SQLite JDBC client for it.

Perry Hoekstra
 
reply
    Bookmark Topic Watch Topic
  • New Topic