public boolean testname(String name)
    {
        Connection con=getcon();
        ResultSet rs=null;
        boolean bs=false;
        try{
            String sql="select * from testtable where name=?";
            PreparedStatement stmt=null;
            stmt=con.prepareStatement(sql);
            stmt.setString(1,name);
            rs=stmt.executeQuery();
            if(rs.next())
            {
            bs=true;
            }
        }catch(Exception e)
        {
            System.out.println(e);
        }

        return bs;
    }