FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Discussion
   General Processing Discussion
(Moderators: fry, REAS)
   grabbing databased info
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: grabbing databased info  (Read 577 times)
ian

WWW
grabbing databased info
« on: Feb 19th, 2003, 9:15pm »

hi - i'm a thorough greenhorn with proce55ing, and was wondering if it's possible to feed it variables off a database. I was looking at the reference and it looks like some of the forthcoming 'file' elements might work for reading a PHP page or a database generated flat file. Anyone tried this? Ideally I'd like to be able to read a bunch of numbers I have in a mySQL database and feed them down through the serial port to a microcontroller. Thanks.
 
fry


WWW
Re: grabbing databased info
« Reply #1 on: Feb 22nd, 2003, 3:29pm »

yeah, the file stuff would let you do that.. some of the file bits are already in there, i.e. loadStrings() returns the contents of a file as an array of String objects.. for example:
Code:
String contents[] = loadStrings("something.txt");
 
for (int i = 0; i < contents.length; i++) {
  // do something with contents[i]
}

you can also use any of the regular java file i/o stuff you might want.  
 
in future releases we'll have methods for including other .jar files, in which case you can just use jdbc and connect to mysql directly (which is how this project works: http://acg.media.mit.edu/people/fry/chromosomes/14/)
 
Pages: 1 

« Previous topic | Next topic »