Results 1 to 3 of 3
  1. #1
    scarletrain is offline Member
    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0

    Default [ASK] Load On Fingerprint Template

    Hi all...
    I have a problem with the load coding in fingerprint template..

    Why if me save 2 or more fingerprint template.. only the last save can be verified.. the first template cannot be verrified..

    Anyone can help me

    Java Code:
    private void onLoad() {
    //to retrieve template from MySQL
    String tempTemplate = "";
    try {
    Connection c = ClassDB.getkoneksi();
    java.sql.Statement s = c.createStatement();
    String sql = "Select * from tes";
    java.sql.ResultSet r = s.executeQuery(sql);
    
    byte[] data = new byte[1];
    while (r.next()) {
    tempTemplate = r.getString(1); 
    data = hexStringToByteArray(tempTemplate); 
    }
    DPFPTemplate t = DPFPGlobal.getTemplateFactory().createTemplate();
    t.deserialize(data);
    setTemplate(t);
    r.close();
    s.close();
    } catch (SQLException e) {
    System.out.println("Have An Error");
    }
    }

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default Re: [ASK] Load On Fingerprint Template

    You need to learn to indent your code properly.
    It's not easy to follow the flow of the code when it's all off to the left like that.

    Anyway, you are reading everything in the 'tes' table, then looping over each row assigning the value to data each time...which is then overwritten the next time round the loop.

    Not knowing what exactly it is you want to do it's going to be hard to help.

    By the way, if that data is supposed to be bytes then you really should store it as a BLOB, not as some strange String thing.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    sevoxx is offline Oracle Java Developer
    Join Date
    Apr 2013
    Location
    In a PineApple Under the Sea
    Posts
    20
    Rep Power
    0

    Default Re: [ASK] Load On Fingerprint Template

    Quote Originally Posted by Tolls View Post
    You need to learn to indent your code properly.
    It's not easy to follow the flow of the code when it's all off to the left like that.
    +1 And I refuse to help anyone until they've formatted their code.

Similar Threads

  1. fingerprint reader
    By Ravi Kurkute in forum Advanced Java
    Replies: 1
    Last Post: 10-03-2012, 05:47 PM
  2. How to load and view Jasper Report template
    By steiger in forum AWT / Swing
    Replies: 1
    Last Post: 12-27-2010, 11:08 PM
  3. fingerprint ridge count?
    By aho123 in forum Java 2D
    Replies: 1
    Last Post: 05-08-2010, 05:04 AM
  4. java integrated with fingerprint device
    By Azarael hashem in forum New To Java
    Replies: 3
    Last Post: 03-28-2010, 05:36 AM
  5. Fingerprint verification
    By venkateshcoolmoon in forum Advanced Java
    Replies: 4
    Last Post: 02-02-2010, 06:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •