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 & HelpIntegration › Possible to *not* embed data contents in applet
Page Index Toggle Pages: 1
Possible to *not* embed data contents in applet? (Read 705 times)
Possible to *not* embed data contents in applet?
Feb 3rd, 2008, 5:47pm
 
Apologies if this is a common question, but I couldn't find any similar posts.  I'm using a SQLite database for my project - this simply being a file that sits in my data directory.  This db file is expected to be several hundred megabytes and would be impractical to have packaged in my jar file when exporting.  Is there anything I can do to use this architecture or am I out of luck?

Thanks,
 Jason
Re: Possible to *not* embed data contents in apple
Reply #1 - Feb 8th, 2008, 11:25am
 
Hi,

 i'm quite new to processing, but from what i know the solution to your problem is to create a dynamic page (php/asp/perl/...) in the web server where the data is stored that accesses this database and then from processing use loadStrings/loadBytes to acces this dynamic page with the parameters needed.
Re: Possible to *not* embed data contents in apple
Reply #2 - Feb 8th, 2008, 11:49am
 
sure, use full URL or path.

.. or, just put it next to your sketchs .pde and use:

loadStrings(sketchPath("yourfilenamehere.txt"));

then after export don't forget to include the file when uploading.

the trick with the server-side scripts is only needed when you load things from other places than the server the applet was loaded from. see note in loadStrings:
http://processing.org/reference/loadStrings_.html

F
Re: Possible to *not* embed data contents in apple
Reply #3 - Feb 8th, 2008, 1:44pm
 
It's funny - I actually started out writing some PHP scripts to handle the MySQL database interaction and then I came across some information about how to use SQLite.  It seemed like a good idea, but I didn't think through the fact that everything would be running client-side and would be impractical.  Back to step 1.

Thanks,
 Jason
Page Index Toggle Pages: 1