• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet to database connection

 
pankaj patil
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have an urgent requirement . how to connect applet with the database

i need the code .

pls help me out

With regards
pankaj
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Accessing a DB from an applet is not different than connecting from any other piece of Java code. Of course, applets are restricted as to which host they can connect to. Specifically, they can only connect to the machine where they originate (i.e., where the web server is located). If the DB is not located on that machine, the applet will either have to be signed (which gets aroung the host restriction), or you will need a DB proxy on the web server host, which takes your DB calls and routes them to the proper DB host.
If you describe in more detail where you are stuck we may be able to give you more specific advice.
 
pankaj patil
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i have written a code in applet but it give me error

specified server not found

with regards
pankaj
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are aware of the restriction I mentioned, that an applet can only connect to the server where it originates? More information can be found in the Applet FAQ, which is linked in my signature.
[ October 22, 2005: Message edited by: Ulf Dittmer ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic