Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-28-2003, 02:44 AM   PM User | #1
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
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.
Josh Campbell is offline   Reply With Quote
Old 01-28-2003, 01:15 PM   PM User | #2
codefox
Regular Coder

 
Join Date: Nov 2002
Location: India
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
codefox is an unknown quantity at this point
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.
codefox is offline   Reply With Quote
Old 01-28-2003, 04:06 PM   PM User | #3
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
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.
Josh Campbell is offline   Reply With Quote
Old 01-29-2003, 04:36 AM   PM User | #4
codefox
Regular Coder

 
Join Date: Nov 2002
Location: India
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
codefox is an unknown quantity at this point
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.
codefox is offline   Reply With Quote
Old 01-29-2003, 08:01 PM   PM User | #5
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
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.
Josh Campbell is offline   Reply With Quote
Old 01-30-2003, 12:01 AM   PM User | #6
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
You can connect to databases via applets. Whoever told you that was wrong.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 01-30-2003, 04:32 AM   PM User | #7
codefox
Regular Coder

 
Join Date: Nov 2002
Location: India
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
codefox is an unknown quantity at this point
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 .
codefox is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:11 AM.


Advertisement
Log in to turn off these ads.