We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Processing Applet and jdbc connecting to MySQL DB
Page Index Toggle Pages: 1
Processing Applet and jdbc connecting to MySQL DB (Read 732 times)
Processing Applet and jdbc connecting to MySQL DB
Dec 13th, 2009, 10:51am
 
Hi there

I have developed a Processing application which runs on my desktop. It connects to a remote database on the web to retrieve the data. All is fine.

I have exported the app and then signed it. However when I load the app on a website and then browse to it with my browser it fails. I have read in previous post both here and else where that you can't use jdbc for applets. Could anyone expand more on the reasoning and what other options I have (I would rather communication with DB). Someone mentioned a PHP script, but not sure I really understand how this is implemented...

Thank you.
Re: Processing Applet and jdbc connecting to MySQL DB
Reply #1 - Dec 13th, 2009, 1:50pm
 
"it fails"
Have you some trace in the Java console?

Anyway, I never tried to use JDBC from an applet. Less because of possible technical issues (I really don't know if it is possible or not) but because you need to put database access credential in the applet and it is very easy for somebody with some knowledge to get this information and mess with your base...

About the PHP script: the idea is to send an HTTP request with some information on the data to retrieve, eg. ?category=car&rangeL=1970&rangeH=1979
PHP analyze the request, to the secure access to the database and spit out some data which can be read, eg. with the loadStrings that issues the request...
Re: Processing Applet and jdbc connecting to MySQL DB
Reply #2 - Dec 14th, 2009, 12:38pm
 
Sorry the error is:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Even though the mysql-connector-java-5.1.6-bin.jar is included in the applet directory.

I shall investigate the php script option, thank you for your prompt responses.
Page Index Toggle Pages: 1