Java question

Feldenak

Lifer
Jan 31, 2003
14,090
2
81
Ok, I'm having issues connecting to my database with my applet. For some reason it is choking on grabbing the driver from the org folder. The folder is in the what I was told was the proper location (same folder as the class & html files). Can anyone point me in the right direction?

Segment of code it's stopping at:
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Try putting the driver jar file in your sdk folder under jre/lib/ext/

That's where my SQL driver is and it works :)
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
#1. Don't use the DriverManager solution for web applications.

#2. I'm gonna guess that you're using tomcat and direct you here. That's a more involved solution than they used to have (uses the mysql connection pool). The old solution used a simpler connection pool from the jakarta commons. You can find documentation for that at roughly the same place in the documentation for tomcat 5.0.x.

#3. Don't use System.out in web applications. It won't kill you if you're just fooling around but a logging package is necessary if you do anything half serious.

#4. Put the driver in the WEB-INF/lib folder or somewhere where your server will pick it up and add it to the class path for all web apps. For tomcat this is common/lib iirc.