Quote:
How can I perform barcode scan
It depend on your settings, hardware, frovers. Either it is like a keyboard entry, either you get it via serial port. In any cases you end up with a string.
Quote:
and retrive/ fetch data based on barcode scan from database
With the string you have got, you do exactly as you usually do, nothing special here.