aspose file tools*
The moose likes I/O and Streams and the fly likes accessing buffer to transfer data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "accessing buffer to transfer data" Watch "accessing buffer to transfer data" New topic
Author

accessing buffer to transfer data

liverpool alan
Greenhorn

Joined: Nov 08, 2000
Posts: 18
Hi, I was wondering if any one can help me with this one.....
I'm reading in data from my serial port.(using Comm API), and I want to take this data and use it elsewhere. Anybody have any ideas about how to go about it???
Alan
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
What do you want to do with your data?
liverpool alan
Greenhorn

Joined: Nov 08, 2000
Posts: 18
I want to transfer it by JDBC to a database....
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Not sure how far you've gotten, hope to not talk beneath you. So you've got some data you captured from the port, you'll probably need to parse it into values that you will eventually stick to the DB.
So of course you need a database, JDBC driver etc. Basically you build a SQL string or set arguments and call a stored procedure.
That's a real generic explanation. What part on you working on now?
liverpool alan
Greenhorn

Joined: Nov 08, 2000
Posts: 18
I kinda learning this as I'm going along so I'm not sure if this is the correct way to put it ......
Currently the data in "inputStream.read();" What I'm working on at the mo is getting the data out of the readbuffer for transfer to the database....
One of my main problems is that there are 2 of us working on it, (one on getting data to the serisl port, and myself on getting it to the db), so I can't trial run the program, even if it compiles....any simple way of simulating this (without getting off the subject!)
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
If I understand you correctly, your job is is put the information gotten to a database. Someone else's job is to get that info. Right?
It shouldn't really matter how the information gets to you (very OO). What you two need to decide on is how you will transfer that info intially. Will s/he pass you a string (this is how it comes from a com port, usually) that you have to parse? Maybe a better idea is to pass you an Object, or an .xml file. That way you two can program to a well-know standard.
Anyway, once you decide, you can test your end by creating test objects/text strings/xml and pass them to yourself. I do this all the time.
Not really sure if this helps. Let me know.
liverpool alan
Greenhorn

Joined: Nov 08, 2000
Posts: 18
thats exactly it michael.
What we hope to do is punctuate the data with "\" or some other symbol(we're working with a string because its handiest and we're running out of time!!)..
Would I be right in saying then that I can parse it into the various different segments and pass them as variables into the database..(I think this is sounding like it would be more appropriate in the JDBC folder)
alan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: accessing buffer to transfer data
 
Similar Threads
How can I retreive the data from the excel sheet
NX(URLyBird):single remote object or multi-remote object?
Data Base DUMP through Java
Can servlets in individual contexts have access to the same session object?
LDAP and Database