 |
Author |
Topic: Processing & MySQL connectivity... (Read 1355 times) |
|
ess

|
Processing & MySQL connectivity...
« on: May 24th, 2004, 10:00pm » |
|
Hi, I'm pretty comfortable with Processing, but I don't know any "real" Java. I'm interested in building the ability to read/write data to a MySQL database into a processing applet. I've already read the previous threads in this forum, but I still have some questions: 1. How far along is the "network" functionality of processing? I've read that it is "in progress". Also, would the planned functions coincide with what I'd like to do (e.g. log-in with username/password, save xml, load xml, etc)? 2. Can I write a processing applet in "java mode" so that I can use the methods found here: http://java.sun.com/j2se/1.3/docs/api/java/sql/package-summary.html if I start my processing code like this: Code: Is that enough to provide access to these methods or must I add the appropriate files the the "data" dir or some other dir? Alternatively, would it be best to copy/paste the .java file produced when exporting-to-web from the p5 PDE into a sun's java developing environment and adding the network functionality I need and compiling it all there? thanks
|
« Last Edit: May 24th, 2004, 10:08pm by ess » |
|
|
|
|
fphunct
|
Re: Processing & MySQL connectivity...
« Reply #1 on: Jun 12th, 2004, 5:50pm » |
|
I've gotten the applet to query a MySQL server in a roundabout way. I wrote a P5 Applet that queries a server that was written completely in regular Java. The server then initiates a connection to the MySQL database and executes the queries and returns the output to the P5 applet. In essence, I basically had to create a middle-man to negotiate queries between the applet and the MySQL server. I believe I did this because I read somewhere that applets aren't allowed to do SQL connections. I might be wrong on this but this is just a suggestion.
|
|
|
|
Euskadi
|
Re: Processing & MySQL connectivity...
« Reply #2 on: Jun 29th, 2004, 3:35am » |
|
i second that. i'm getting data from a database into processing on a website. Database reads, 2 ways: 1) the page (PHP) when it is created, writes PARAMs into the page that the applet reads 2) the applet sends requests to another php page for data, the page responds Database updates: 1) the applet opens another PHP page that receives the request for updates, and responds back with a confirmation that the update to the DB has been made. if you're looking for a way to make this work, try searching for "servlet", it's a pretty generic term to describe what my php pages are doing. if you're using MySQL I assume you're online, using PHP?? JSP will work the same way for you
|
|
|
|
Euskadi
|
Re: Processing & MySQL connectivity...
« Reply #3 on: Aug 14th, 2004, 4:36am » |
|
i assume if you have MySQL then you probably also have PHP... I just posted to the "processing & PHP" topic how I got 1500 records into my DB ... sorry, no example online, the last thing I need right now is more random data. (but I included some code)
|
|
|
|
|