01-28-2003, 03:44 AM
I am a bit confused about applet versus application. Can an application be run online or is it strictly offline? An applet can be run offline. The reason I am asking this is because I want to be able to access a file and a database and I think I remember someone saying that you can only do those things in an application.
Thank you for any help for this Java newbie.
01-28-2003, 02:15 PM
An applet is a program run on the browser. It's seriously handicapped for good, in the sense you cannot read or write files or access memory on your machine. Maybe I shouldn't say it's handicapped cause an applet does what it's designed to do pretty well, though I hate it being sluggish.
Now that you say you want to connect to a database, that could be done using an application. So how does an application differ from an applet? An application can do far more than an applet could. First off, it can run as a separate entity and does not require a browser. Of course, it does require a JVM. Regarding the online-offline query, yes, an applet can be run only offline. i.e., it's downloaded to your machine and run. A java application can connect to computers, connect to databases, read/write files (in fact, the best thing I like about java is its variety of stream objects some of which you can use to manipulate files), etc. To connect to a database you can use JDBC.
01-28-2003, 05:06 PM
You say that an application does not require a browser. If I wanted could I make it run in a browser? I am trying to develop a database program that is in the users browser window instead of making them download and run it themselves.
Could you reccomend a tutorial or reference for JDBC?
Thank you for your help.
01-29-2003, 05:36 AM
You couldn't run an application in a browser because that could compromise the system security. Nevertheless, you could use servlets, or JSP to let clients connect to databases in your server.
As regards JDBC tutors, you could search for it in google. I just read some of the JDBC Fundamentals (http://developer.java.sun.com/developer/onlineTraining/Database/JDBC20Intro/JDBC20.html) page at sun's site and that helped me with connecting to databases using JDBC.
01-29-2003, 09:01 PM
Servlets and JSP are like CGI/ASP/PHP. They just build webpages. How do online java chess games like yahoo's or cyberjoueur's do it. They have an applet that loads stuff from database, how else could you play with others and enter games and stuff?
If I have to build an application I'd just do it in C++ but I'd rather have it available in browser and in Java since it is easier to program.
01-30-2003, 01:01 AM
You can connect to databases via applets. Whoever told you that was wrong.
01-30-2003, 05:32 AM
I never connected to databases using an applet. I knew I could do that using a java application. Sorry about misleading you to think that you couldn't connect to databases using an applet .:D