• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Leonidas Savvides
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This
return this.editStmt.execute(); // gives error , how to code in Android/sqlite?

 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Perry Hoekstra
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic