2

I am trying to create an application which reads IDs of blood samples via a barcode reader. How do I read a barcode from a barcode reader into a Java Application for further processing (e.g pulling patient details from database)? Example code and explanations much appreciated.

P.S same applies to fingerprint reader, also need to be able to pull data from database based on usb fingerprint reader. how do I get fingerprint reader data into the java application for further processing?

Thanks in advance, Tumaini

BlakkPhoenixx
  • 345
  • 3
  • 4
  • 9
  • 1
    I just answered a similar question in depth [**here**](http://stackoverflow.com/questions/8146840/barcode-scanner-implementation-on-java), with an example of my implementation (I didn't want to use a keyboard hook because I didn't want to require focus on the program before interpreting a scan). – egerardus Dec 23 '11 at 23:26

1 Answers1

3

It really depends on the hardware you are using (i.e. The Barcode scanner) most scanners simulate keyboard input and will for example write a string of numbers + a termination character.

e.g. 1 2 9 7 6 5 [ENTER]

If your hardware does simmilar you will be able to trap this as text input in Java - no specialist coding needed.

A simple way to test what your hardware does is open up a text editor, scan a barcode - then view the output on the screen (with special characters included)

diagonalbatman
  • 17,340
  • 3
  • 31
  • 31