Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jdbc j2ee MySQL

 
Kushal Das
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I created a jdbc resource in Sun java system applicatin server 8;
I want to use it from an applet in a jsp page running from that server..
But i got the error for initial context.
It gives the error

Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

I need some immidate help.



kD
 
Julian Kennedy
Ranch Hand
Posts: 823
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since your applet runs on the client machine it doesn't have access to the JNDI config info (e.g. java.naming.factory.initial) unless you supply it as an applet parameter. I'm not sure it will work even then, but you can try it. If you need immediate help, I suggest you read the manual - immediately.

Jules
 
Kushal Das
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There what parameter should i pass?
There is nothing in the manual for this case.
It is written that the value can be passed as parameter or it will be taken from a jndi.properties file.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An applet is running on the client's browser, not in the server's managed environment, and can access none of the J2EE facilities you've come to know and love. If your setup is anywhere near sane, it won't be able to directly access the database anyway.

Make the applet use HTTP requests back to the server. There's a whole raft of technologies you could use: plain old HTTP requests, RMI over HTTP, Hessian/Burlap, and so on. You might enjoy using CachedRowSet as well, depending on what you want to achieve.

- Peter
 
Kushal Das
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Then there should be any option by which my applet can use the database.
How can i use the jdbc resource.
Can my applet can talk to an EJB there...???
I am new to the j2ee environment.
In the program, i need to show some data from the MySQL server in an applet. It will also contain picture (BLOB) data.
Please visit my projects site:-
Career Sangi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic