Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Java Applet Application

    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.

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 page at sun's site and that helped me with connecting to databases using JDBC.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Thanks again.

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You can connect to databases via applets. Whoever told you that was wrong.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #7
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •