java - 使用java中的u are u数字角色验证指纹

标签 java digital-persona-sdk

我正在尝试使用数字角色 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);
           }
       }
   }

最佳答案

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

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

关于java - 使用java中的u are u数字角色验证指纹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59165959/

相关文章:

java - 将类型推广到 Java 中的类型系统

java - 在 Android Wear 设备上显示我们的应用程序通知

c# - 如何在 C# 中从 SQL Server 验证 DPFP 指纹

java - 有没有办法将指纹数据提取到图像中?

reactjs - 带有 webusb 的指纹扫描仪

java - selenium如何继续往下一页填充数据?

java - 如何使现有的 Java 类/接口(interface)实现成为单例?

java - Spark Combinebykey JAVA lambda 表达式