【问题标题】:Verifying fingerprint using u are u digital persona in java使用 u 验证指纹是 java 中的数字角色
【发布时间】:2019-12-03 21:55:45
【问题描述】:

我正在尝试使用数字角色 sdk 验证指纹。我可以使用以下代码捕获模板并将其保存到 MySQL 数据库,但问题出在验证期间。当我尝试验证指纹时,它总是显示失败。 这是注册和验证码。我会发布注册代码,但由于代码冗长,stackoverflow 无法让我发布


protected void process(DPFPSample sample) {
       super.process(sample);

       // Process the sample and create a feature set for the enrollment purpose.
       features = extractFeatures(sample, DPFPDataPurpose.DATA_PURPOSE_VERIFICATION);

       // Check quality of the sample and start verification if it's good
       if (features != null) {
           // Compare the feature set with our template
           DPFPVerificationResult result = verificator.verify(features, ((MainForm) getOwner()).getTemplate());
           // updateStatus(result.getFalseAcceptRate());
           if (result.isVerified()) {
               try {
                   DPFPTemplate templat = ((MainForm) getOwner()).getTemplate();
                   byte[] vrr = templat.serialize();

                   pst = con.prepareStatement("select fingerprint from accounts where fingerprint=?");
                   pst.setBytes(1, vrr);
                   rs = pst.executeQuery();
                   if (rs.next()) {
                       JOptionPane.showMessageDialog(this, "Fingerprint doesn't match the User ID", "Unable to Login", JOptionPane.ERROR_MESSAGE);

                   } else {
                       JOptionPane.showMessageDialog(this, "Fingerprint doesn't match the User ID", "Unable to Login", JOptionPane.ERROR_MESSAGE);

                   }

               } catch (SQLException e) {
               }
           } else {
               makeReport("The fingerprint was NOT VERIFIED.");
               JOptionPane.showMessageDialog(this, "The fingerprint was NOT VERIFIED.", "Verification Failed", JOptionPane.ERROR_MESSAGE);
           }
       }
   }

【问题讨论】:

  • 如果 (result.isVerified()) 为真,也许你可以解释你正在尝试做什么,并展示你是如何捕获和保存指纹的。

标签: java digital-persona-sdk


【解决方案1】:

将语句编辑为-> if(rs.next){

JOptionPane.showMessageDialog(this,"指纹成功匹配 USERID"); }

【讨论】:

  • 请提供解释它将如何提供帮助,而不仅仅是一段代码。
猜你喜欢
  • 2017-06-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-08-09
  • 1970-01-01
  • 1970-01-01
  • 2015-01-09
  • 1970-01-01
相关资源
最近更新 更多