File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class.forName()

 
aakash bhatt
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the significance of the code Class.forName() while doing a connection?

Thanks,
aakash
 
Rodney Cabahug
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Class.forName() will try to load the class that you specified as string argument. If the class that you specified cannot be found in the classpath, Class.forName() will throw a ClassNotFoundException.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm thinking that you're curious about the significance of this code in the context of JDBC. So, I'm moving this to the JDBC forum...
 
Julian Kennedy
Ranch Hand
Posts: 823
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It registers the JDBC driver. Check the API docs for java.sql.Driver and/or java.sql.DriverManager for more info.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic