I have assigned key to every entity in my Data store. but when i click on delete , i am not able to delete it ..Please help me regarding that.
I have created a function "deleteuser()" inside my SAFCServlet.java class , which i am trying to invoke when trying to delete .My function is :
SAFCServlet.java
.............
public static void deleteuser(string name)
{
Key UserKey = KeyFactory.createKey("safc",name );
System.out.println("the value od userkey is" +UserKey);
ds.delete(UserKey);
}
above function i am calling from Delete.java Servlet
Delete.java
..................
String key1=req.getParameter("key").toString();
PrintWriter out = resp.getWriter();
out.println("I m in delete");
System.out.println("the first key is "+key1);
SAFCServlet.deleteuser(key1);
The above Servlet "Delete.java" gets called when i click on delete,but i am not able to delete .please help me with that.The "key1" in above function is the key (this key is usergenerated not the inbuilt key of data store) of every entry in my datastore
MY TABLE IS .For Example:
KIND is "safc" (means Table name)
key|Title(data)|Author
78 |john |laxmi
99 |Andy |ashish
We can create any entity like this in datastore :
Entity e = new Entity("safc");
e.setParameter("username");
e.setParameter("password");
e.setParameter("Key");
ds.put(e);
While trying to delete from datastore i am getting error in my code and i am not able to resolve it.code i used is shown above in" Delete.java" servlet and "SAFCServlet.java" , i found this somewhere and i was trying to implement it.