• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class.forName() doubt

 
sridhar lakka
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Thanks in advance.
In regular JDBC program we will write,
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").
According to my knowledge, which will regsiers the drivers and Loads the class, is it rite?
And, actually which will returns a "Class", but we are not taking return like,Class cl=Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"), then how java is allowing.
Please tell me.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's perfectly legal to ignore the result of a method call. The call has side effects -namely, that the driver gets registered-, and those are important here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic