wood burning stoves 2.0*
The moose likes Applets and the fly likes Using mySQL with Applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Using mySQL with Applets" Watch "Using mySQL with Applets" New topic
Author

Using mySQL with Applets

Jackie Jarboe
Greenhorn

Joined: Feb 09, 2007
Posts: 4
After using PHP I was surprised at how difficult it is to get an Applet to store data on the host machine. I found some CGI programs and used them to
keep the data. Would an mySQL database be a reasonable way to store data collected by an Applet? Or is there a better way to use Java and MySQL for web applications?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Applets are nothing like php. If you want the rough Java equivalent of php, look into JSP.

That's like saying "after driving a car, I was amazed to find how hard is to get around on a lawnmower".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jackie Jarboe
Greenhorn

Joined: Feb 09, 2007
Posts: 4
I would still like to know if it would be possible to store data, from an online quiz I did with applets, in a student database that is SQL. Are you saying that it would be about as easy as driving a lawn mower to work? Now, we are not saying here whether its a push mower or a riding lawn mower, but maybe that doesn't matter.

I knew this wasn't the easiest thing to do with Applets. It was awkward to try to go from one page to the next. But I was really surprised that you can directly store info on the server holding the program. I can understand not being able to store info on the client's computer.

So would JSP work along with SQL?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Originally posted by Jackie Jarboe:
I would still like to know if it would be possible to store data, from an online quiz I did with applets
To get this question answered I'm going to move this to the Applets forum. I don't know of any reason that an applet can't make JDBC calls, but having never written one in my life there may be restrictions that I know nothing about.

So would JSP work along with SQL?

Yes. Many a database-driven web application is front-ended using JSP. If you are going to be going down that road, be sure to post questions in the JSP forum as there are some miportant considerations regarding web application structure that should be taken into account from the start.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Originally posted by Jackie Jarboe:
I would still like to know if it would be possible to store data, from an online quiz I did with applets, in a student database that is SQL.


It's possible if the database is on the same server where the applet is hosted, but using JDBC from within an applet is generally not recommended for security reasons.


Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Sounds like it's JSP that you're after.

If you are familiar with php, I'm not sure why you went down the applet road to begin with.
 
 
subject: Using mySQL with Applets