File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Jdbc j2ee MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Jdbc j2ee MySQL" Watch "Jdbc j2ee MySQL" New topic
Author

Jdbc j2ee MySQL

Kushal Das
Greenhorn

Joined: Aug 27, 2004
Posts: 4
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

Joined: Aug 02, 2004
Posts: 823
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

Joined: Aug 27, 2004
Posts: 4
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

Joined: Apr 20, 2000
Posts: 3252
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

Joined: Aug 27, 2004
Posts: 4
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jdbc j2ee MySQL