Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applet Problem 1

Status
Not open for further replies.

ksoong

Programmer
Oct 3, 2000
57
CA
Hi. I will try to include as detailed a description of the scenario as possible. I am trying to build an Applet which will connect with a MySQL database. I am trying to run this applet on a webpage that is hosted on Spaceports with the URL in the following format:
I programmed this applet using JBuilder foundation 4. Running the applet from JBuilder works perfectly. I am using JDBC - using the API that is supplied from the MySQL website. I ran into the driver problems before so i included the API in a package. That worked great for JBuilder.

But when i try to view the applet on a web page it says that it cannot find the class.

The applet is: msa.class
It was programmed to be a part of a package called "msa"

I made an archive called msa.jar, which includes msa/msa.class and the API from MySQL. I am calling the code using the following HTML:

<applet
code=&quot;msa.msa&quot;
archive=&quot;msa.jar&quot;
height=300
width=150>
</applet>


i've also tried:
<applet
code=&quot;msa.msa.class&quot;
archive=&quot;msa.jar&quot;
height=300
width=150>
</applet>

and many many other variations. I've tested to see whether it is my browser that is the problem by running other applets and even including them beside the msa applet and they all run perfectly. But the msa does not load. When I move my mouse over the applet a message briefly flickers across the status bar of my Browser saying &quot;load: class msa.msa not found&quot;

I am wondering whether it could be because the Spaceports.com web site has a MySQL database which can only be referenced by &quot;localhost&quot; and the &quot;~blah&quot; is causing problems.

i thought that it's just a problem with the way my archive and class reference is being done. but i'm not sure.

Please help.

Ken
 
i forgot to add that in JBuilder, I connect via &quot;Localhost&quot;.
 
Open up your Java console. You might be able to find some clues there. If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
while the reference to localhost may prevent your code from executing correctly, it wouldn't prevent the system from finding your class...can u try this scenario using a simple applet without any kind of package specific location and c if that works first??
 
Hi. yep. i tried that already and it works fine. I tried running another applet on the same page (i.e. some text scroller) and it ran perfectly. it was not in a package or an archive of any sort. when i run other applets in other packages developed by other people they seem to run fine though. just not for mine.
 
try and run your applet with out the package stuff and get it working first, then gradually build it up.

also, do a search of your local machine ensure the jar file is being downloaded.
 
Ok....

i did just that. i worked up to it. It looks like the applet was giving me problems because of the way JBuilder automatically built it.

however, now, i'm at a different problem. The applet is running but it is not getting past the connection point to MySQL. It is bombing out there. It connects fine in JBuilder but in the browser it doesn't work. I am running the database right now, on localhost.

any thoughts?

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top