File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access databse from Applet?

 
Robert Ploch
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
We have to create a game as JApplet. This Applet should load the levels/tasks from the project-page level by level, not instantly when the game starts.
The Applet should also load Hiscores while loading the game and save them after finishing the game into a database.
The main problem is, that we dont exactly know which technology to use.
We don`t have much experience in databases and connection-based programming, therefore it need`nt be fast. The maximum number of players is estimated about 100 at time.
Could you give me the best option for this problem? We discussed implementing a SQL-DB, which would fit our interests(and retrieving the stats) best.
Or does a better version exist?
With regards
Robert
 
danny liu
Ranch Hand
Posts: 185
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My option is:
a. build a database component on the server side which connects to DB using JDBC
b. build EJBs that implement business logic via that database component
c. rewrite your applet to utilize the EJBs

Hope it helps.
Dan
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB are overkill in almost all cases, this being one of them.
I think a fullblown database may be overkill here as well.
Store the levels as flat files which are cached in memory by the serverside process for performance.
Highscores can be stored in either an embedded database or also in a flat file (again, memory caching may be called for).
Create a simple server process communicating with your applet using a TCP/IP socket.
Make it multithreaded (thus you need to make your caching and/or data access code threadsafe).
 
wally fer
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can
1. have Applet to Servlet communication
2. servlet talks to the database
or
Have signed applet which directly talks to remote database. (Risky business)
 
Robert Ploch
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so far for your suggestions.
@wally
Is the whole servlet-story difficult to implement? We only have 2-3 weeks time for that, without any experience in database-design ans so on.
It is also very hard to find sourcecode for this adventure, does anybody have some examples?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic