G
getsanjay.sharma
Hello to all programmers out there.
I was just wondering:
· 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?
· 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:
public void start()
{
if(target != null)
target.run();
}
· I am currently facing a peculiar problem in which on one hand using
the Class.forName("com.mysql.jdbc.Driver") works for a local program
but the same raises a ClasssNotFoundException when run on localhost ?
Thank you for your time.
I was just wondering:
· 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?
· 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:
public void start()
{
if(target != null)
target.run();
}
· I am currently facing a peculiar problem in which on one hand using
the Class.forName("com.mysql.jdbc.Driver") works for a local program
but the same raises a ClasssNotFoundException when run on localhost ?
Thank you for your time.