【问题标题】:update data using java code in android在android中使用java代码更新数据
【发布时间】:2012-08-24 07:31:40
【问题描述】:

如果我必须在 mysql 数据库中插入数据意味着我们使用以下代码:

PropertyInfo unameProp =new PropertyInfo();
unameProp.setName("userName");//Define the variable name in the web service method
unameProp.setValue(selectedItem);//Define value for fname variable
unameProp.setType(String.class);//Define the type of the variable
request.addProperty(unameProp);

这里使用了addproperty....如何编写更新android中mysql数据库中数据的代码...请帮助我...

【问题讨论】:

  • Android 不支持 mysql。你是说服务器端吗?
  • Android 中的 MySQL 并不是解决这个问题的最简单方法...
  • 是的,我知道...我必须在这里调用soap webservice
  • 请参考这个链接:stackoverflow.com/questions/12104500/…给我解决方案

标签: java android mysql propertyinfo


【解决方案1】:

android 支持 sqlite

您必须使用内容值在 android 中插入数据库

    ContentValues values = new ContentValues();
     values.put("userName", selectedItem); 



     db.insert(yrtbl, null, values);
     db.close();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-17
    • 1970-01-01
    • 2018-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-09
    • 1970-01-01
    相关资源
    最近更新 更多