when I used jdk1.1, this method works fine, but when it is upgraded to jdk1.3, the following error pops up: ***************** ... java.net.URLClassLoader.findClassURL ... ... at java.lang.ClassLoader.loadClassInternal at java.lang.ClassLoader.forName(native method) ********************* Can someone help out a solution that will work in both jdk1.1 and jdk1.3 ? Thanks, Mike
Hi Mike, Make sure that class you are going to load is in your classpath first. second, you should look at top of stack trace, there is a reanson why it throws such exception. JDK1.3 is using same method. but you may use Class.forName("your.class").newInstance(); I wish it would help??? [ March 22, 2002: Message edited by: Sunny Liu ]
If I am rich, I will spend more.<p>IBM 486 (OOAD & UML) & 141 (XML) passed<br />Oracle 1Z0-007 passed<br />MCSD MCDBA MCSE <br />SCJP SCSSA<br />CCNA CNA A+
the argument I used inside the Class.forName() is something like "com.sun.jdbc..." driver name. so I didn't put it in the classpath. The point is it worked fine in jdk1.1 but not 1.3. I also tried the "Class.forName().newInstance()", same error happens.
Oh, I want to add, I used "getProperty()" kind method to get the Driver_names and put it into Class.forName(). It works fine in jdk1.1, but failed in jdk1.3 with the above error. The driver name is in the classpath indeed. please help with some insight. Thanks, Mike
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
a bit of art, as a gift, the permaculture playing cards