wood burning stoves 2.0*
The moose likes JDBC and the fly likes Class.forName()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Class.forName()?" Watch "Class.forName()?" New topic
Author

Class.forName()?

rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151
In all jdbc connection classes i find this code

Class.forName("some driver String");

and the weirdest thing is that the return type(of class Class) is not stored anywhere. There is no assignment here. Then What is the use of this code?


Cheers!
RSR
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

This question has been discussed before on JavaRanch. Look here: Class.forname() return .
Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Class.forName()?
 
Similar Threads
Class Loading Doubt..
Nullpointer exception in servlet
class.forName ()
package sun.jdbc does not exist
jdbc with microsoft SQl Server 2008