public boolean update(int id,String name)
    {
        Connection con=getcon();

        boolean bs=false;
        try{
            String sql="update testtable set name=? where id=?";
            PreparedStatement stmt=null;
            stmt=con.prepareStatement(sql);
            stmt.setInt(2,id);
            stmt.setString(1,name);
            int a=stmt.executeUpdate();
            if(a==1)
            {
                bs=true;
            }
        }catch(Exception e)
        {
            System.out.println(e);
        }

        return bs;
    }