Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can applet access database directly?

 
Caroline Iux
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a question from IBM certification pre-assessment site. The cert is about IBM software Visual Age for Java. But I have a problem with an applet-related question. I personally don't have too much experience with applets, so I am counting on you applet gurus to explain it to me. Thanks!
Which of the following are true with respect to configurations of Java solutions that allow many individual clients to access a database on a centralized host computer:
(b,c)?

a) an Applet must go through a Servlet to gain access to a database.
b) a web browser can utilize a Servlet which in turn can access the database through a database driver.
c) a web browser can run an Applet which in turn can access the database through a database driver.
d) a Servlet should use the Java Native Interface (JNI) to gain access to a database.

Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
 
Jimi Rock
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Caroline,
B & C are correct as I think according to my previous applications..
when using an applet, it is just a few lines of code to establish a JDBC connection to the database and specify the required driver.
not all the drivers can access a remote database.
Regards,
MAC.

[This message has been edited by Jimi Rock (edited July 30, 2001).]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18225
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
** concurrence **
A is false - you CAN go through a servlet, but you don't HAVE to
D is false - you CAN use JNI to access a database (e.g. invoke MS SQL Server via a JNI class wrapping ADO), but it's not a good idea - JDBC is much more portable, ergo, you SHOULD *NOT* use JNI (as opposed to CAN not or MUST not!).
 
Caroline Iux
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic