Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,238 members, 7,818,799 topics. Date: Monday, 06 May 2024 at 04:17 AM

How Do I Convert Finger Print Image To Binary Stream?..help Pls - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How Do I Convert Finger Print Image To Binary Stream?..help Pls (1575 Views)

How Do I Convert Object To Arrey In Javascript / How Do I Convert My Jpg Files To Doc And Pdf. / Excellent Image To Pdf Creator (2) (3) (4)

(1) (Reply) (Go Down)

How Do I Convert Finger Print Image To Binary Stream?..help Pls by duke2017: 9:18pm On Feb 28, 2017
pls is there anywhere I can convert finger print minutiae to binary stream so I can send it to database?.
Re: How Do I Convert Finger Print Image To Binary Stream?..help Pls by Nobody: 10:53am On Mar 01, 2017
duke2017:
pls is there anywhere I can convert finger print minutiae to binary stream so I can send it to database?.

create a database to store the fingerprints

store.sql


create a table containing user ID and print

`userID` varchar( 32 ) NOT NULL ,
`print1` varbinary( 4000 ) DEFAULT NULL

look at the jar library and copy the the method

binary stream .



private byte [] loadDataFile() {
// TODO Auto-generated method stub
JFileChooser fc = new JFileChooser( new File( "test" ));
fc . showOpenDialog( this );
if (fc . getSelectedFile() != null ) {
InputStream input = null ;
try {
input = new BufferedInputStream( new FileInputStream(
fc . getSelectedFile()));
byte [] data = new byte[input . available()];
input . read(data, 0 , input . available());
input . close();
return data;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e . printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
JOptionPane . showMessageDialog( null , "Error saving file." );
}
}
return null ;




u will see something this copy the class from jar of ur sdk
Re: How Do I Convert Finger Print Image To Binary Stream?..help Pls by Nobody: 11:37am On Mar 01, 2017
Add. java

import java.io.File;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public static Connection getConnection() throws Exception {
String driver = "org.gjt.mm.mysql.Driver" ;
String url = "jdbc:mysql://localhost/databaseName";
String username = " root";
String password = "root" ;
private static final String tableName = "users" ;
private static final String userColumn = "userID" ;
private static final String print1Column = "print1"

Class.forName(driver); Connection conn = DriverManager.getConnection(url, username, password);
return conn; }
private void saveDataToFile( byte [] data ) {
System . out . println( new String (data));
// TODO Auto-generated method stub
JFileChooser fc = new JFileChooser (new File ( "test" ));
fc . showSaveDialog( this );
if (fc . getSelectedFile() != null ) {
OutputStream output = null ;
try {
output = new BufferedOutputStream ( new FileOutputStream (
fc . getSelectedFile()));
output . write(data);
output . close();
} catch ( FileNotFoundException e) {
// TODO Auto-generated catch block
e . printStackTrace();
} catch ( Exception e) {
// TODO Auto-generated catch block
JOptionPane . showMessageDialog( null , "Error saving file." );
}
}
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e . printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
JOptionPane . showMessageDialog( null
}
}
return null ;
public void insert (int id , byte [] binary ){
PreparedStatement st;
try {
st = cn() . prepareStatement( "INSERT INTO users(username, f1) VALUES(?, ?)" );
st . setInt( 1 , id);
st . setBytes( 2 , print1);
st . executeUpdate();
} catch (SQLException e) { System . out. println(e . getMessage()); }
Re: How Do I Convert Finger Print Image To Binary Stream?..help Pls by Nobody: 12:41pm On Mar 01, 2017
Re: How Do I Convert Finger Print Image To Binary Stream?..help Pls by Nobody: 12:41pm On Mar 01, 2017
check the codes and test them.


the finger with be stored in binary or any other formats................
Re: How Do I Convert Finger Print Image To Binary Stream?..help Pls by duke2017: 5:11pm On Mar 01, 2017
thank u Boss..I will try it out though I don't really understand the codes
Re: How Do I Convert Finger Print Image To Binary Stream?..help Pls by OpssonD1: 5:39pm On Mar 01, 2017
Inasmuch as I would love to post a python script that does the aforementioned task, I rather would urge you to learn the basics of writing codes. Simplify the problem by breaking it down logically on paper. Do not form the habit of asking for codes. Post what you have done so far and let us help solidify your knowledge by guiding you on what to do next or where exactly you seem to be wrong.

1 Like

Re: How Do I Convert Finger Print Image To Binary Stream?..help Pls by Nobody: 6:37pm On Mar 01, 2017
OpssonD1:
Inasmuch as I would love to post a python script that does the aforementioned task, I rather would urge you to learn the basics of writing codes. Simplify the problem by breaking it down logically on paper. Do not form the habit of asking for codes. Post what you have done so far and let us help solidify your knowledge by guiding you on what to do next or where exactly you seem to be wrong.
sir please post it

(1) (Reply)

Get Your Web And Android Tutorial Videos @ Rivers/Port Hacourt / . / C# Vs Java

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.