This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Reading data through client COM1 port  from server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading data through client COM1 port  from server" Watch "Reading data through client COM1 port  from server" New topic
Author

Reading data through client COM1 port from server

siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Hi Friends,
I have to read data from bardcode scanner,i have program program to read the from local machine by configuring some of the files,my problem is i have to read the data from clients port , please give me an idea if possible please give me program .

Thanks in advance

My program is

To execute the below program we need to configure
1)win32com.dll in C:/WINDOWS
2)javax.comm.properties in jre/lib

package com.port.read;


please give me an idea i am in very bad situation

JCE: Please use Code Tags
[ December 29, 2008: Message edited by: Joe Ess ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

You need to Tell The Details. You've shown us some code, which I believe is from the Java Comm API examples, but you haven't told us if it compiles, what happens when you run it, and what you want it to do. Fill in those blanks and maybe we can be of some assistance.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Hi Joe,
Thank you for your reply.The actual process is there is simple jsp page with a text box when the bardcode scanner reads the data, i have to display the data in the text box(some id:123123) using this id i have to get data of the employee.

The class which was given by me is used to Listen the barCode scanner by using SerialPortListener interface , when ever the scanner got hit serialEvent() method will read the data .But this is working in my local machine.

My Problem is i have to read the data from client machine.

I hope you understand my problem.

Thanks in advance.
Siva.
vipin jos
Greenhorn

Joined: Nov 18, 2008
Posts: 24
Hi Siva,

You have stated that you are using a JSP and also you have stated that it is on client.

Hope you meant "HTML on client browser". Am I right?

If this is so, you wont have any use with the Listener java class.

I believe you would need to use JavaScript and use ActiveX toolkits like the following.

http://www.activexperts.com/activcomport/howto/html/

Hope this helps.

Thanks,
Vipin
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

So your problem isn't with the above code, it is with getting data from the barcode scanner to a page displayed in a browser?
First, does the barcode scanner have a native driver? The barcode scanners I've seen convert the barcode to key strokes, so it is no different than getting data from the keyboard. You'd just have to keep the browser and text box in focus.
If that is not an option, java.awt.Robot can simulate mouse and keyboard actions.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Reading data through client COM1 port from server
 
Similar Threads
Send SMS by using Serial Port
help using javax.comm api
unable to read the data from serial port in rfid
how can I send the output of a servlet to a jsp page?
Java Comm API... Please respond