views:

33

answers:

3

I have written an applet that connects mysql. Since i connect mysql it uses additional library.(JDBC Driver for MySQL (Connector/J)) When i finished writing and try to run on Netbeans there is no problem but i did not figure how to put that class into a html file. Do i have to put whole netbeans project up or what should i do?

A: 

Read this tutorial from Sun/Oracle

  1. Package as jar
  2. Create jnlp
  3. Create HTML
willcodejavaforfood
A: 

Make the main class extends JApplet

Build the project

Find the jar

Then add this code to your HTML

<applet code = '<appletClassName>' 
    archive = '<jarFilePath.jar>', 
    width = xxx, 
    height = yyy />
Louis Rhys
But it uses another java library called JDBC Driver for MySQL (Connector/J)), so, how can i add to the applet when i try to use that into a html file?
put the library .jar in the same folder as the applet .jar
Louis Rhys
A: 

If you have the JDBC driver set up in the Netbeans project properties, all you have to do is build the project and then go into your NetbeansProjects folder (wherever your Project folder is) and open up the build folder. It should have a sample HTML document along with the necessary files to run the applet.

ChrisKS