Hi,
I have a Class.forName("com.mysql.jdbc.Driver") inside a doPost of a servlet deployed in JBoss (know its not the correct place to put it, but I was trying to do something quick and am just curious about servlet classloading).
I get a ClassNotFoundException. I presume, although against best practices, I am allowed legally to do a Class.forName(...) here - why do I get this error. It might be because the javax.sql are not loaded. If I place a j2ee.jar there, what are the implications? Would this work?
Thanks,
Roger
ps- I assume that the classloader of the thread which is servicing my request is the same classloader as that my webapp used - i.e. everything I put in lib I should be able to reference?
I have a Class.forName("com.mysql.jdbc.Driver") inside a doPost of a servlet deployed in JBoss (know its not the correct place to put it, but I was trying to do something quick and am just curious about servlet classloading).
I get a ClassNotFoundException. I presume, although against best practices, I am allowed legally to do a Class.forName(...) here - why do I get this error. It might be because the javax.sql are not loaded. If I place a j2ee.jar there, what are the implications? Would this work?
Thanks,
Roger
ps- I assume that the classloader of the thread which is servicing my request is the same classloader as that my webapp used - i.e. everything I put in lib I should be able to reference?