Forums Register Login

class.forname...working

+Pie Number of slices to send: Send
Hey!!
can anybody please explain the actual working of the class.forname() method....esp with reference to the memory.....the concepts....also what happens when i say "class.forname(oracle.jdbc.driver);".....what happens internally
+Pie Number of slices to send: Send
The JVM (probably a ClassLoader) finds the class of that name and loads a Class<T> object into the memory used by the JVM. In the case of the JDBC connector classes, I believe there is a static initialiser block which initiates the connection to the database.
+Pie Number of slices to send: Send
Whenever a class gets loaded, all of its static variables get initialized and static initializer blocks get fired. You know, 'static' applies on the class itself and has no instance dependence.
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 954 times.
Similar Threads
Loading Driver.
class.forName n statement interface
class.forname...working
Re:Class.forName()
Load the class thru class.forName() method
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:48:13.