Is it bad to connect to a database via an applet?

A

Andrew Thompson

If something is JWS based.  Is that a regular java app, just launched
on the client via Java Web Start?

JWS apps are usually (J)Frame based, though they
can also be a (J)Applet. They are generally launched
directly from a link on the web, and are automatically
updated when the jar's on the web are (next time the
user launches the app.).

Yes, they /run/ on the clientside and are rich clients
with all the trimmings (including desktop integration,
claiming interest in file types, + other things).

As far as there being 'no Java' on the client side, I
disagree. At least 60%* of machines on the client side
would already have Java, perhaps as many as 90%* of
gaming or business oriented machines have it. For those
that have not got it, Sun devised the deployJava.js
script. It is intended to check and install a minimum
Java from a web page.

And besides - thin clients suck, unless they blow.

* Statistics courtesy of Andrew's WAGs.
 
A

Andrew Thompson

...
Interesting comment - where do you see the advantage in maintenance costs?

I meant to mention this on my first REply on this thread.

Folks - please trim posts!

..now

Start here

Applets
<http://www.google.com/search?as_q=applet&as_sitesearch=bugs.sun.com>
3217

JWS based apps
<http://www.google.com/search?
as_q=webstart&as_sitesearch=bugs.sun.com>
699
<http://www.google.com/search?as_q=jws&as_sitesearch=bugs.sun.com>
618
<http://www.google.com/search?as_q=jaws&as_sitesearch=bugs.sun.com>
195

All the bugs mentioning JWS add up to somewhat less than the
3217 hits for applets. This number merely reflects my
experience with both applets and JWS launched apps or applets.

The real problem lies in the wild and wacky interaction of
applet/JRE/browser/JS engine (the JavaScript engine is not
often relevant - but when it comes into play, it can cause
memory leaks and all sorts of trouble).

While there was one problem involving IE 7 on Vista that
affected both applets and JWS apps *launched using IE*, the
JWS apps. generally avoid any 'browser interaction' problems,
and never suffer from interference from the JS side of things.
 
D

Dave Miller

Andrew Thompson wrote:
\
Applets
<http://www.google.com/search?as_q=applet&as_sitesearch=bugs.sun.com>
3217

JWS based apps
<http://www.google.com/search?
as_q=webstart&as_sitesearch=bugs.sun.com>
699
<http://www.google.com/search?as_q=jws&as_sitesearch=bugs.sun.com>
618
<http://www.google.com/search?as_q=jaws&as_sitesearch=bugs.sun.com>
195

All the bugs mentioning JWS add up to somewhat less than the
3217 hits for applets. This number merely reflects my
experience with both applets and JWS launched apps or applets.

The real problem lies in the wild and wacky interaction of
applet/JRE/browser/JS engine (the JavaScript engine is not
often relevant - but when it comes into play, it can cause
memory leaks and all sorts of trouble).

While there was one problem involving IE 7 on Vista that
affected both applets and JWS apps *launched using IE*, the
JWS apps. generally avoid any 'browser interaction' problems,
and never suffer from interference from the JS side of things.

A bugs to maintenance cost ratio?

http://ocw.mit.edu/OcwWeb/Mathematics/18-05Spring-2005/CourseHome/

The original post was concerning web delivery of a game. The simplicity
or complexity of the game would probably be more meaningful in
determining whether to use JWS or an applet.
 
A

Andrew Thompson

Andrew Thompson wrote:

bug hits..
...
A bugs to maintenance cost ratio?

Not really. Or perhaps rather 'that is only the tip
of the iceberg'.

The devil lay in the details of some of those hits.

Follow a few of the applet hits to find things like
"..this week in the latest release of Mozilla the
entire applet reloads when the user scrolls 'up'".

The 'write once, test everywhere' principal hits
with a vengeance when it comes to applets, and even
after they are released and in production, you had
best keep an eye on the bug database for the latest
nasty little surprise.
The original post was concerning web delivery of a game. The simplicity
or complexity of the game would probably be more meaningful in
determining whether to use JWS or an applet.

JWS can launch applets. A complex applet can be
developed as a hybrid. So, either I do not see
your point, or if I *do* see your point, I disagree
with it.

But then, it sounds ..vaguely, like you are trying to
convince yourself that it is 'still OK to deploy
applets embedded in web pages'.

It never was, they are a kludgy mix of thin and rich
client, and the deployment situation only gets worse
with time, not better.

OTOH - If you are really wedded to the idea of
embedding applets - don't let me stop you.
 
D

Dave Miller

Andrew said:
But then, it sounds ..vaguely, like you are trying to
convince yourself that it is 'still OK to deploy
applets embedded in web pages'.
It never was, they are a kludgy mix of thin and rich
client, and the deployment situation only gets worse
with time, not better.

It was and is "OK" to use the technology that works best for s
particular situation.

http://www.w3.org/TR/html401/struct/objects.html

OTOH - If you are really wedded to the idea of
embedding applets - don't let me stop you.

On the contrary, you seem to want to deprecate perfectly workable
solutions. If it's the latest and greatest that you seek, lose Applets
and JWS and move to Flash.
 
A

Andrew Thompson

It was and is "OK" to use the technology that works best for s
particular situation.

http://www.w3.org/TR/html401/struct/objects.html

What is 'some W3C *recommendation*' of HTML
elements intended to support?

Note that Mozilla based browsers do not even
*recognise* the 'object' element*. To get a
common element supported by browsers to embed
applets, you need to use the (HTML 3.2 based)
<applet> element. (Ignoring that horrid,
unmaintainable, invalid - according to W3C
recommendations - nested object/embed element
hat Sun recommended for far too long).

* There was bizarre circumstance in which I
got one version of a Mozilla browser to recognise
the object element, but only if the element
lacked any versioning information - and then you
may as well use HTML 3.2 and the APPLET** element.

** *Which is just what Sun uses in its deployJava.js.,
after the scirpt has ensured minimum version is
available*

So, what exactly was pointing to the W3C HTML
definition of an object element supposed to
..prove, exactly?

That you know the W3C exists? Hurrah..
On the contrary, you seem to want to deprecate perfectly workable
solutions.

Applets? Live and learn.
If it's the latest and greatest ..

Your the first to mention that. JWS has existed
since Java 1.2.2, BTW.
 
D

Dave Miller

Andrew said:
What is 'some W3C *recommendation*' of HTML
elements intended to support?

Note that Mozilla based browsers do not even
*recognise* the 'object' element*. To get a
common element supported by browsers to embed
applets, you need to use the (HTML 3.2 based)
<applet> element. (Ignoring that horrid,
unmaintainable, invalid - according to W3C
recommendations - nested object/embed element
hat Sun recommended for far too long).

* There was bizarre circumstance in which I
got one version of a Mozilla browser to recognise
the object element, but only if the element
lacked any versioning information - and then you
may as well use HTML 3.2 and the APPLET** element.

** *Which is just what Sun uses in its deployJava.js.,
after the scirpt has ensured minimum version is
available*

So, what exactly was pointing to the W3C HTML
definition of an object element supposed to
..prove, exactly?

That you know the W3C exists? Hurrah..


Applets? Live and learn.


Your the first to mention that. JWS has existed
since Java 1.2.2, BTW.

operor non nutritor...
 
A

Arne Vajhøj

Andrew said:
Your the first to mention that. JWS has existed
since Java 1.2.2, BTW.

JWS runs with Java 1.2.2+.

JWS has been bundled with Java 1.4+.

JWS was first released (as standalone download) 2 months
before Java 1.3.1.

Arne
 
A

Arne Vajhøj

Andrew said:
Note that Mozilla based browsers do not even
*recognise* the 'object' element*. To get a
common element supported by browsers to embed
applets, you need to use the (HTML 3.2 based)
<applet> element. (Ignoring that horrid,
unmaintainable, invalid - according to W3C
recommendations - nested object/embed element
hat Sun recommended for far too long).

* There was bizarre circumstance in which I
got one version of a Mozilla browser to recognise
the object element, but only if the element
lacked any versioning information - and then you
may as well use HTML 3.2 and the APPLET** element.

How many of the tests on:
http://www.mozilla.org/quality/browser/front-end/testcases/oji/objecttests.html
does your FF fail on ?

Arne
 
A

Andrew Thompson

I am talking about a standard FF 2.

Oh, OK. I am guessing your point is that
Mozilla has since added support for the
Object element.

Since I have no FF immediatley handy, and
not enough bandwidth to download even a 5
Meg 'minimalist' version - I'll trust you/them
that it now works.

When was the decision to support the object
element made?
 
R

Richard Maher

Hi jm,
Yes and thank you to everyone. I only need the applet because I need
a richer graphical environment than a regular webpage, and I don't
want to use Flash, Flex, or Silverlight. I thought about JavaFX, but
not sure and the tools are all there yet. Plus I just want to use
Java (and associated variations, jsp, etc.)
<<<<<<<<

Look, this is gonna be one of those really annoying posts that tells you
what you explicitly didn't ask for; sorry about that. But for the benefit of
others who may read this later and are wondering whether some combination of
Java Applets and Flex/Flash may be possible, let me please offer the example
(and pointer to source code) below. To me RIA is a broad church; not a case
of either/or but rather a case of best tool for the job. (In my example, I
found Flex Socket support to be not up to scratch and therefore wanted to
stick with my Java Applet for network comms to the DB, but still use Flex
for what it's brilliant at!)

Cheers Richard Maher

PS. Scanning through NASDAQ.COM recently, I see they're starting to do
similar things with stock charts no longer being static. (If only Adobe
fixed their FABridge example link then NASDAQ may discover the wonders of
the FABridge (or external interface direct) rather the Web1.5
"chartHolder.innerHTML=showChart(blah)".

PPS. Let me point out a *HUGE* problem with Silverlight. It not only
restricts you to Ajax as a datasource; it restricts you to *Microsoft's*
version of Ajax! Adobe says "Do whatever you like!".

PPPS. Is there not a Socket or BufferedInputStream flag I can toggle that
says don't return until "N" bytes or Error? Arne, if you're reading, similar
to ucx$c_msg_blockall. No real hardship to loop till full or error, but this
is a pretty common TCP/IP stream requirement.

PPPPS. Aparently it *doesn't* work on Safari (but does on the same box OS-X,
JVM, FlashPlayer with FireFox), if someone knows why please tell me.

EXAMPLE: Anyway, here 'tis : -

If you'd like to see an example of a browser-based Flex/HTML/Javascript GUI
client talking to a VMS 3GL server, please click on: -

http://manson.vistech.net/t3$examples/demo_client_flex.html

and have a gander.

Username: TIER3_DEMO
Password: QUEUE

You *must* be running: -

.. The *latest* version of Adobe's Flash Player (Adobe and FlexBuilder
generate the code for version checking and auto-download but I left it out
of the example for brevity)
.. JVM 1.4-2 or later (Java 6 has been out for over a year; what's wrong with
ya :)
.. If you are behind a firewall that disables outgoing connections then you
must open up to destination port 5255.
.. You must have Javascript and Applets enabled for your browser
.. Apart from that I've tested it with IE6/7 and Firefox and others have it
working on Safari and Opera

Now, sadly, I was unable to obtain any sort of Rdb Hobbyists license for the
Deathrow Cluster so I've had to provide a fudge in that the data is
hard-coded in DEMO_UARS.COB :-( But if you want to see what the Rdb code on
our machines looks like then peruse: -

http://manson.vistech.net/t3$examples/

For all of the source code: -

Server: -

demo_flex.cob (Cobol server code)
build_flex_demo.com (Creates the UAR shareable)
demo_flex_sql.sqlmod (SQL you guessed it)

Client: -

demo_client_flex.html }
employee_lookup.html } All the Application-specific html
avoidpatent.js }

bridgetest.mxml } The Flex driving logic (I can't believe it's that small!)

Those who are familiar with demo_client_web.html are already familiar with
the example Java classes and CornuCopiae.html. NB: *NO* new Java was created
for the new application! Code reuse and modularity set to maximum!

Cheers Richard Maher

ps. If you'd like to see this on HP's TestDrive Cluster *with* Rdb then tell
me (or better still tell your HP rep!) Maybe it's just me, but surely you'd
be forgiven for wondering why Oracle/Rdb or HP/VMS would not seize on this
opportunity to promote and support their wares?

pps. If you haven't worked it out yet :) hover over the pie charts and
click for data drill-down.

I was kinda confused by Arne first comment too, but "user specific
accounts" in his second reply makes it plain what he is getting at here.

If your applet or JWS program can access a database, so can anyone else.
Your database is "bare" on the 'net and anyone at all can connect to
it anytime he or she wants. It's a security hole.

So, with that in mind: servlets can be one way to implement the
protection needed on your server to prevent unauthorized access your
database.

However, especially in the case of JWS, the answer might even be
"probably not" with respect to using servlets as middleware. Certainly
it possible to write your own protection layer in Java, deamonize it,
and then let it listen for connections and provide the level of security
desired.

Servlets do have some built-in advantages. The networking code is done
for you already. Port 80 is almost always allowed on client system.
And SSL provides encryption, which will be necessary for any real form
of security. But using servlets should be weight against all other
options. It's not a given and definitely not the only choice.

Well I hope this was at least partly clear....

Yes and thank you to everyone. I only need the applet because I need
a richer graphical environment than a regular webpage, and I don't
want to use Flash, Flex, or Silverlight. I thought about JavaFX, but
not sure and the tools are all there yet. Plus I just want to use
Java (and associated variations, jsp, etc.)
 
A

Arne Vajhøj

Andrew said:
Oh, OK. I am guessing your point is that
Mozilla has since added support for the
Object element.

Since I have no FF immediatley handy, and
not enough bandwidth to download even a 5
Meg 'minimalist' version - I'll trust you/them
that it now works.

It seemed to work fine for me with a FF 2.0.0.14/Win32
for all the tests.
When was the decision to support the object
element made?

I don't know.

Arne
 
A

Arne Vajhøj

Lew said:
The combination of AJAX and JSF looks especially promising, although I
haven't yet the skills in either to judge.

It is a very cool combo.

Get the smooth AJAX user experience without manually writing
JavaScript code.

But it is server side Java.

The closest to a recent client side Java success is probably GWT
that translates Java code to JavaScript. So the developers code
in Java and the browsers run JavaScript.

That is somewhat client side Java.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top