I’m trying to write a simple Applet which must get text data from database.
I have some problems:
- I have remote mysql db or i can create a local db, what would be the
most correct? -
I have downloaded mysql-connector-java-5.1.22-bin.jar and put it to
my applet source directoryyakoot@yakoot-home:~/java$ echo $CLASSPATH
/home/yakoot/java/mysql-connector-java-5.1.22-bin.jar
but when I try,
Class.forName("com.mysql.jdbc.Driver");
I see
error: unreported exception ClassNotFoundException; must be caught or
declared to be thrown
Class.forName("com.mysql.jdbc.Driver");
I tried some different locations for mysql-connector-java-5.1.22-bin.jar, but it did not help
Put your MySQL JAR File in Class Folder Instead. i.e. if you are using netbeans you need to choose include library/JAR Folder. then browse mysql-connector-java-5.1.22-bin.jar file.
Then rebuild the source and run again.