What does Class.forName return?
Answers were Sorted based on User's Feedback
The Class.forName( String name ) returns a java.lang.Class
object associated with the class or interface with the
specified fully qualified name.
| Is This Answer Correct ? | 17 Yes | 2 No |
Answer / karthik
Class.forName attempts to load the class whose name is
given in its only argument, and returns the Class instance
representing that class. In the
event that the Class could not be found, resolved, verified,
or loaded, Class.forName
throws one of several different Exceptions
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / rajiv
hi......
Class.forName() is basically used to load the diver. forName() is static method thats why its directly call with class name( i:e Class)
which return java.lang.class object. n with the help of that object we establish the connection with database.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / prashant
Class.forNmae first loads the class in current classLoader so as to use that in future. Internally DriverManager gets the reference of the driver by using dynamic laoding (nothing is magical) this is is the reason when you say manager.GetConnection() it returns connection using the loaded driver
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sushant
the database hs been created using SQL server which is ODBC
complaint. Hence the JDBC-ODBC bridge driver will be used
to communication width the database the folloeing
statement will be used to load this driver
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / surya, samcomm technologies pv
yes. It does return Class type.
code:-
try {
Class clazz=Class.forName("");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Difference between servlet and applet method?
give me a java code snippet to connect Microsoft excel through.... I am trying alot... plz help me.
HI ALL, How to Overcome "OutOfMemoryException"? when I am compiling source having more than 1000 LOC throwing this exception. Can any one give correct answer to my question? thx
Explain the locking system in jdbc & its types?
What is JDBC Batch Processing and what are it’s benefits?
What are the main steps in java to make JDBC connectivity?
How to get the Database server details in java program?
What is JDBC PreparedStatement?
What do you mean by two phase commits?
What is the difference between triggers and procedures?
How to find that, a row is updated or not?
What is jdbc driver?