• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Class.forName?

 
Pavan Sambare
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you load a JDBC driver you use Class.forName to load it. Any reasons why?
What I thought is that you can pass an externalized string to Class.forName and thus use any Driver at runtime.
Does it also have to do something with ClassLoader hierarchy?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a search through this forum. THis question gets asked a lot, so there will be loads of answers. Als ohave a read through our JDBCFaqs, these cover a lot of the basics of JDBC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic