   Multi User Persistant Data (Java)
  Ok I am working on a java applet. This applet will be hosted publicly and multiple users should beable to access it concurrently (at the same time). Also any changes made by one user should show up on the second users applet if that user logs in after the changes have been made.Now, I originally thought that this would be best suited by a MYSQL server, but as I remembered. Java executes on the local system, not on the server side. This would require me to have the MYSQL server exposed to the public connecting from any host. This isnt a problem, it just makes me think that there should be a better solution.I have been thinking about including a SQLlite file in the Jar and getting the information from that, but I have been told that SQLlite is best for single user access only.So I was wondering if any of you have any suggestions on a better way to facilitate the requirements of my applet.Thank you very much in advance.   
Quote:Original post by LuminaryNow, I originally thought that this would be best suited by a MYSQL server, but as I remembered. Java executes on the local system, not on the server side. This would require me to have the MYSQL server exposed to the public connecting from any host.You could write a Java servlet that connects the the MySQL server. Your applet can then talk to the servlet.Quote:I have been thinking about including a SQLlite file in the Jar and getting the information from thatSQL lite would also be running on the local system, so the data wouldn't be shared :/;  That sounds interesting...And then just connect to the Servlet using Sockets...   ;Quote:Original post by LuminaryNow, I originally thought that this would be best suited by a MYSQL server, but as I remembered. Java executes on the local system, not on the server side. This would require me to have the MYSQL server exposed to the public connecting from any host.Yeah, you don't really want to expose your db to the world. Instead you should use a server-side language (like php, perl, or j2ee) to write an interface to your db. The server-side code would do data verification and sanity checking so that only allowable operations are allowed.Then your applet talks to your php/perl/whatever code over regular http much like a browser would. Http support is built in to the java sdk (see Url and UrlConnection).A handy side effect of this is that if your server-side code returns text or xml then you can debug the sever code by just pointing a browser at it.   ;  Hmm, that is clever.I have never parsed XML in java. Do you have any suggestions of online resources on how to best set that up?NVM.. I walked my but over to google and fired it in and got some good stuff.Thanks everyone for the help now i have some solutions.   ;HeyI am implimenting the suggestion and I have the PHP Server side returning XML queries from the server which are then parced by Java and it is working beautifully.I was wondering.. I am using A DocumentBuilder to parse the XML file from the URL.I am still very new to Java but is there a way I can add a layer in between the inputstream and the Document builder so that I can encrypt and decrypt the data so that I dont have plain text transmitting from the server to the client?I guess I am just looking for a way to store the input from the input stream so that I can decrypt it and then feed it to the documentBuilder to be parsed.Thanks for any help that you may provide.   ;Quote:Original post by LuminaryI am still very new to Java but is there a way I can add a layer in between the inputstream and the Document builder so that I can encrypt and decrypt the data so that I dont have plain text transmitting from the server to the client?You can wrap the output stream in a CipherOutputStream, which will encrypt all data that goes through it. Similarly there is a CipherInputStream for decrypting.You'll have to make sure you're using the same algorithm and key on the client and the server so they can communicate. You'll probably want to find out what php decryption libraries you have available and find a common algorithm (AES or Blowfish are widespread). Heres the list of algorithms supported at the java end.   ;  Yeah, I have been able to impliment Rijndael 128bit on the PHP side which is more than enough security for my needs.