• 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

accessing buffer to transfer data

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you want to do with your data?
 
liverpool alan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to transfer it by JDBC to a database....
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic