| Author |
Class.forName()
|
aakash bhatt
Ranch Hand
Joined: Jan 09, 2003
Posts: 182
|
|
What is the significance of the code Class.forName() while doing a connection? Thanks, aakash
|
 |
Rodney Cabahug
Greenhorn
Joined: Sep 01, 2004
Posts: 1
|
|
|
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
Joined: Dec 10, 2001
Posts: 7023
|
|
|
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...
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
Julian Kennedy
Ranch Hand
Joined: Aug 02, 2004
Posts: 823
|
|
|
It registers the JDBC driver. Check the API docs for java.sql.Driver and/or java.sql.DriverManager for more info.
|
 |
 |
|
|
subject: Class.forName()
|
|
|