• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Scan item code and store in the database

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a requirement and I am not sure how to start working on it. Any ideas can help.

The user is going to scan an item. The system has to find the type of item scanned , example the scanned item is bread
and store that in the database. This is the general idea. Is it even possible to do something like this.

Thanks
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course, assuming you can interface with the scanner (some are simply serial-based and pretty easy to interact with).
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

Assuming I have a scanner, when the item gets scanned where does it store that code.
Also how can I find the item name, for example if bread is scanned I do not want the brand name bread.
Only the item eg it has to return "bread".

If it is web based application, can this stored in a database and then displayed in jsp?

Thanks
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether or not it's a web app isn't relevant (although if it's a web app getting scanner input could be more difficult) to how data is stored.
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Justin

Assuming I have a scanner, when the item gets scanned where does it store that code

That is scanner dependent. You will have to read the developer guide of your scanner to learn how to interact with it.

Also how can I find the item name, for example if bread is scanned I do not want the brand name bread.
Only the item eg it has to return "bread"

A scanner does not scan this info. It only scans codes.
You will need to store a translation table between these codes and the display label somewhere.

If it is web based application, can this stored in a database and then displayed in jsp?

Sorry, I do not get the link between what you do with the scanner and what your web application should do. Can you please explain the scenario?
But in general: yes. A web based application can display data from a database, and you can store scanned information in a database.

Regards, Jan
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the detailed reply. It is very helpful.
The requirement in detail::
The user will login to the web application. For entering the ingredients required for the recipe , the user will scan the items.
The scanned items will be displayed to the user. (eg: bread, butter,pepper etc). The user enters the quantity of each these scanned items.

  You will need to store a translation table between these codes and the display label somewhere. 


Correct if I am wrong. I thought the code for each item is unique ie for example Brand name A Bread has a unique code and Brand name B Bread has a different code.
So will I have to store the item code for each brand name for every ingredient to deduce the ingredient?

Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The user will login to the web application. For entering the ingredients required for the recipe , the user will scan the items. The scanned items will be displayed to the user. (eg: bread, butter,pepper etc). The user enters the quantity of each these scanned items.


So this web app has a client part that interacts with the scanner. That most likely means a signed applet that interacts with the scanner and the various pages of the web app.

I thought the code for each item is unique ie for example Brand name A Bread has a unique code and Brand name B Bread has a different code.


Yes, but do you have the list of all barcodes and their associated brands/product categories? I doubt that you can find that online (just a hunch, but an educated one). If this application is for a chain of markets, or a manufacturer, then you should be able to get that information from them, but otherwise, you're on your own.
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are scanners that act as a keyboard. They enter the scanned code in the active cursor position.
For not so advanced use they are the easiest to implement and integrate. Search wikipedia for "Keyboard wedges".
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

My problem is two fold.

1. How can the scanner interact with the web app and enter the scanned values in the database.

That most likely means a signed applet that interacts with the scanner and the various pages of the web app.


Can you please elaborate on how to achieve this?

2. How to convert the bar code to something meaningful.
I do not have a list of codes and associated products.
Recently I had seen an android app, that lets you take a picture of the bar code and the app returns the details of the item.
Not sure how they do it.

Thanks
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Recently I had seen an android app, that lets you take a picture of the bar code and the app returns the details of the item.
Not sure how they do it.

They must have used a cross reference in the background. Barcodes don't carry that info.

In the image above (belonging to gs1), the only info captured in the barcode is the number 5412345678908 (the same one as printed below the label). No other information can be retrieved from this code. You will have to find the additional info somewhere else.

Regards, Jan
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Justin Howard wrote:Recently I had seen an android app, that lets you take a picture of the bar code and the app returns the details of the item.
Not sure how they do it.


That's easy--it's relatively easy to decode the bar code. Then they do a simple web search for the resulting code--the URLs used for searches can be changed, too.

If you don't have a list of codes and products, you'll need to do the same thing. As far as extracting metadata regarding the product, like "bread", good luck.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Justin Howard wrote:1. How can the scanner interact with the web app and enter the scanned values in the database.

That most likely means a signed applet that interacts with the scanner and the various pages of the web app.


Can you please elaborate on how to achieve this?



An applet can both 1) interface with a scanner through a serial port, and 2) work with the web app, like enter values into a text field, or submit forms to the server, do web lookups etc. For part 1, the applet needs to be signed, because otherwise it can't access peripherals on the client; see HowCanAnAppletReadFilesOnTheLocalFileSystem for more detail on that. In a previous life I've actually worked on a project that used the RXTX library to access a client-side scanner. For part 2, check out the Common DOM API, which allows applets to interact with web page they're embedded in.

Having said that, the approach mentioned by Jan sounds intriguing if your scanner hardware supports it.
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jan, Ulf and David.

All the information helped me understand better.

Looks like finding the meta data from the bar code seems to be a problem.
Scanning to the web app seems achievable.

I wonder if this is even the correct approach to enter the ingredients required for the recipe.

Thanks

 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Having said that, the approach mentioned by Jan sounds intriguing if your scanner hardware supports it.


Actually I was intrigued by David's suggestion that a simple web search could return information about the product corresponding to a UPC. That sounded dubious to me, so I got my package of transit tickets out of my wallet and keyed the UPC (669721000043) into Google. And lo and behold, the first link that Google returned was to a site called "upcdatabase.com" which did actually know about my transit tickets.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

upcdatabase.com


I just grabbed a random item out of my fridge, but it's not recognized by that site. It apparently relies on volunteers supplying information, which probably rules out a lot of commercial products. But I guess YMMV.
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

upcdatabase.com



I checked something random too. Returned exactly what I looking for (eg:036000003178)

But I am not sure if I can write anything relying on only this website.

Found this in the website too.

UPC lookup code
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course you can't *rely* on the barcode being present anywhere, and you certainly can't rely on the kind of metadata you're looking for.
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the industry I work in, we as supplier have to feed an independent data pool with product master data.
Our customers subscribe to this pool, and can receive that data (security is involved, we can say which partners get the data).
There are rules on when and how data is provided and changed. Our customers never have goods from us in their shop that they don't know of.
They can *rely* on having the data. The website below can't.

You can find info when you yahoo for "GDSN Certified data pool".
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jan Cumps wrote:In the industry I work in, we as supplier have to feed an independent data pool with product master data.
Our customers subscribe to this pool, and can receive that data (security is involved, we can say which partners get the data).
There are rules on when and how data is provided and changed. Our customers never have goods from us in their shop that they don't know of.
They can *rely* on having the data. The website below can't.



Likewise in the industry I work in, when we buy a product from one of our suppliers, the supplier tells us what the UPCs for the product are. We wouldn't have any use for a hobby site which contains UPC information of unknown reliability. But we don't know what business Justin Howard is in.
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote: But we don't know what business Justin Howard is in.

No. But we know what he has in his cupboard. I just looked up the item represented by 036000003178.
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just for information: in Europe we don't use UPC barcodes for goods, we use EAN (European Article Number) barcodes (usually the 8 or 13 digit version).

According to Wikipedia EAN 13 is a superset of the UPC, but I don't know how the EAN 8 numbers fit in.

UPC

EAN



Probably there are more different codes in other parts of the world...
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Bengler wrote:Just for information: in Europe we don't use UPC barcodes for goods, we use EAN (European Article Number) barcodes (usually the 8 or 13 digit version).



Yes, and in North America we were all supposed to have converted from UPC to GTIN by 2005. I think that was meant to unify EAN and UPC, and maybe it actually happened, but I know the use of the term "GTIN" is very rare here. People still say "UPC" and we still mostly have the same barcodes on consumer products.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And metric back in the 70's.
 
reply
    Bookmark Topic Watch Topic
  • New Topic