Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8803675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:24:07+00:00 2026-06-14T01:24:07+00:00

Am writing a SOAP web service method to compare a template with a feature

  • 0

Am writing a SOAP web service method to compare a template with a feature set using digital persona sdk in java. I need to retrieve the template which is a string in database then convert it to a byte array in order to do the matching with the feature set. My input parameters for the web method is email and ftSet which are both string. Ftset also needs to be converted into byte array, these are done after the try catch block. How can i get access to the variable named “dbTemplate”?

@WebMethod(operationName = "CheckTemplate")
public String CheckTemplate(@WebParam(name = "email") String email,
        @WebParam(name = "ftSet") String ftSet) {

    Connection con = null;
    try {
        Class.forName("com.mysql.jdbc.Driver");
        con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb", "root", "1234");
        PreparedStatement st;
        st = con.prepareStatement("select template from Tbl_reg where email = ? ");
        st.setString(1, email);

        ResultSet result = st.executeQuery();

        if (result.next()) { //.next() returns true if there is a next row returned by the query.

            String dbTemplate = result.getString("template");


        }
    } catch (Exception e) {
        System.out.println(e.getMessage());

    } finally {
        if (con != null) {
            try {
                con.close();

            } catch (SQLException e) {
            }
        }
    }


            byte[] byteArray = new byte[1];
//dbTemplate is underlined here, cannot access it from the try catch
            byteArray = hexStringToByteArray(dbTemplate);
            DPFPTemplate template = DPFPGlobal.getTemplateFactory().createTemplate();
            template.deserialize(byteArray);


            byte[] fsArray = new byte[1];
            fsArray = hexStringToByteArray(ftSet);
            DPFPSample sample = DPFPGlobal.getSampleFactory().createSample();
            sample.deserialize(fsArray);

            DPFPFeatureSet features = extractFeatures(sample, DPFPDataPurpose.DATA_PURPOSE_VERIFICATION);


            DPFPVerification matcher = DPFPGlobal.getVerificationFactory().createVerification();
            DPFPVerificationResult result1 = matcher.verify(features, template);

            if (result1.isVerified()) {

                return "The fingerprint was VERIFIED.";

            } else {
                return "The fingerprint was NOT VERIFIED.";

            }  

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:24:09+00:00Added an answer on June 14, 2026 at 1:24 am

    Declare dbTemplate after declaring the Connection object. In your code, dbTemplate is declared within the try block so anything after the try block does not know what it means.

    Connection con = null;
    String dbTemplate = null;
    

    Nobody other than this “if” block knows what dbTemplate is.

    if (result.next()) { //.next() returns true if there is a next row returned by the query.
        String dbTemplate = result.getString("template");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a soap web service: Jboss + Hibernate + Java. Database on PostrgreSQL.
I'm fairly new to writing web services. I'm working on a SOAP service using
I'm writing some code to talk to a web service via WSDL-SOAP. I'm using
I've been tasked with writing a SOAP web-service in .Net to be middleware between
So I'm writing a Ruby client for a SOAP web service, and I've figured
I'm currently writing a web service using WCF in VB.NET. Previous web services I
I'm writing a java web service that returns a custom type. Everything works fine
I'm writing a web-service for Android. The client side will be coded in JAVA
I am writing a Java web services client using Metro/WSIT libraries, and the web
I am writing a Java web service for legacy SCO machines (which only have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.