what does the method Class.forName returns?
Answers were Sorted based on User's Feedback
Answer / m.gangadhar
first it loads th class name at run time
second it executes the static initializer containg the code
of driver class i.e
then it creates the object for the driver class and
registers that object in to the DriverManager
|Is This Answer Correct ?||15 Yes||1 No|
Answer / priyank jain
Static method Class.forName(String className) returns the
Object for the classname specified in argument passed to
Also Class.forName used to load drivers.
Ex. In JDBC call
automatically creates an instance of a EmbeddedDriver and
registers it with the DriverManager.
|Is This Answer Correct ?||15 Yes||5 No|
Answer / choudarygariabbai
static Class<?> forName(String className)
Returns the Class object associated with the
class or interface with the given string name.
|Is This Answer Correct ?||8 Yes||2 No|
Answer / uv
When Class.forName("<classname>") function gets
executed,the class gets loaded in JVM.
To create an object and access its functions and variables,
we can use getInstance( ), please look into the below
Class c = Class.forName("Cls");
Object o = null;
o = c.getInstance( );
// type casting the Object
Cls cl = (Cls) o;
|Is This Answer Correct ?||7 Yes||1 No|
Is uri the same as url?
What is two-phase commit in the database?
Explain jdbc savepoint?
Differentiate between a statement and a preparedstatement.
Does JDBC support stored procedures?
What are the differences between statement and preparedstatement interface?
Can we return resultset in java?
How many types of JDBC Drivers are present and what are they?
Is the JDBC-ODBC Bridge multi-threaded?
What is data source in java?
How can you create jdbc statements?
How do you determine the sensitivity of the ResultSet object?