Forums Register Login

Class.forName() doubt

+Pie Number of slices to send: Send
Hi All,
Thanks in advance.
In regular JDBC program we will write,
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").
According to my knowledge, which will regsiers the drivers and Loads the class, is it rite?
And, actually which will returns a "Class", but we are not taking return like,Class cl=Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"), then how java is allowing.
Please tell me.
+Pie Number of slices to send: Send
It's perfectly legal to ignore the result of a method call. The call has side effects -namely, that the driver gets registered-, and those are important here.
I've read about this kind of thing at the checkout counter. That's where I met 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 730 times.
Similar Threads
package sun.jdbc does not exist
Loading mechanism of Jdbc Driver
jdbc
An JDBC problem
insert statement is not working
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:10:00.