Hey.
I am trying to connect to a MySQL database using
java, I have successfully installed the
jdbc driver. I know this for a fact because when I create an actual java 'application' and run a query, It works fine and I get the desired result. But when I try and connect to the database from an
applet, I get the following error:
java.lang.ClassFormatError: com/mysql/jdbc/Driver (Bad magic number)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at Chatroom.init(Chatroom.java:24)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I am running WinXP and Apache, with j2sdk1.4.2_04. I'm not sure if the error is in my code, or the way I have the server running. I am very new to java, here is my source code below:
Thanks, any help would be appreciated.
- Jenova Child
[ April 23, 2004: Message edited by: Jenova Child ]