I was reading a bit about the JDBC, i've made a lot of programs related to JDBC, but i've never been able to understand the concept of Class.forName().
Please explain it fully, i know the basics, as what are the strings passed, what is done and all. I wanna know the working of not only forName method but also the class CLASS.
PLEASE HELP

Recommended Answers

All 4 Replies

An instance of the Class class represents a class in your program. Using that instance you can find and access all the attributes of that class (variables, methods, annotations etc etc). Its used as part of Java reflection (that's the keyword to Google), which is used to find out the attributes of a class at runtime because you don't know them at compile time.
Here's a good place to start
http://download.oracle.com/javase/tutorial/reflect/index.html

thank you so much sir, for help

My pleasure, but please don't call me "sir"!

ok........ well no problem, i called u sir, bcz u r THE JAVA GURU for me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.