User:Sumit99dutta

public ArrayList Viewall(Itemlistform form) {Itemform i=null; try {		Statement s=getDBConnection; ResultSet rs=s.executeQuery("select * from item ");

while(rs.next) {			i=new Itemform; i.setitemname(rs.getString(1)); i.setitemtype(rs.getString(2)); i.setitemprice(Integer.parseInt(rs.getString(3))); form.getItemlist.add(i); }		System.out.println("sasdd :: "+i.getitemname); return form.getItemlist; }	   catch(Exception e)		{ e.printStackTrace; }	  return null; }	public boolean modifyItem(Itemform i)	{ boolean flag=false; try {	Statement s=getDBConnection; System.out.print(i.getitemname); System.out.print(i.getitemtype); System.out.print(i.getitemprice); System.out.print("herere"); s.execute("update item set itemtype='"+i.getitemtype+"', itemprice='"+i.getitemprice+"'where itemname='"+i.getitemname+"'");

flag=true; }   catch(Exception e)	{ e.printStackTrace; }  return flag; }	public boolean deleteItem(Itemform i)	{ boolean flag=false; try {	Statement s=getDBConnection; System.out.print(i.getitemname); System.out.print(i.getitemtype); System.out.print(i.getitemprice); System.out.print("herere"); s.execute("delete item where itemname='"+i.getitemname+"'"); flag=true; }   catch(Exception e)	{ e.printStackTrace; }  return flag; }

} ///////////////////////////////////////   

    

   /////////////////////////////////