插入数据失败了,你把生成的SQL语句翻出来看看就知道了。

解决方案 »

  1.   

    import java.sql.SQLException;
    这一句
      

  2.   


    public Uri insert(Uri uri,ContentValues values){
    long id=db.insert(DB_TABLE,null,values);
    if(id>0){Uri newUri=ContentUris.withAppendedId(People.CONTENT_URI, id);
    getContext().getContentResolver().notifyChange(newUri, null);
    return newUri;
    }
    求教高手,这里为什么报错?
    throw new SQLException("Failed to insert row into" + uri);
            
    }这个方法你都return 了  还抛什么异常啊~     你要抛异常  请添加在return 前
      

  3.   


    求教高手,这里为什么报错?
    throw new SQLException("Failed to insert row into" + uri);
    这句话  后面加个return null;   
      

  4.   

    异常的类型不对,应该是android.database.SQLException不是java.sql.SQLException