About the return of Class.forName(driverName);

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bsadhukhan
    New Member
    • May 2007
    • 4

    About the return of Class.forName(driverName);

    When we connect database, we first load driver with code like
    Code:
    Class.forName(driverName);
    .
    Now forName() has a return of type Class or Object. But we dont keep that return type, we sure that it is in heap location.
    Anyone can tell me about that return element(Class/Object)?
    Or is there any use of that return element?

    Please help me.
  • Sean Pedersen
    New Member
    • Dec 2010
    • 30

    #2
    This is a guess. I can't think of anything I've used which behaves this way.
    Code:
    try {
        Object o = Class.forName(driverName);
    } catch (Exception e) {
        Class.forName(driverName).doMethods();
    }

    Comment

    Working...