Can anyone explain me Class.forName() syntax ?
This is used in jdbc but I don't find this Class anywhere in API collection of J2EE and also I dont find forName()
Can anyone explain how it works?
thanks
Printable View
Can anyone explain me Class.forName() syntax ?
This is used in jdbc but I don't find this Class anywhere in API collection of J2EE and also I dont find forName()
Can anyone explain how it works?
thanks
JDBC (for the most part) is part of the JSE . And, although the method "forName" of the class "Class" is used very often when using JDBC (for loading the Driver), the class "Class" is not part of JDBC, but rather is one of the base classes for Java itself and is, of course, part of the JSE.
syntax
Class.forName("sun.odbc.jdbc.JdbcOdbcDriver");
in case of sql connectivity
now
Class is a base class in the J2se API not in J2ee API so look core java documentation.it contains the forName() method.used for loading drivers.,
Hi,
The Systax:
Class.forName("DriverName");
You can find this Class in java.lang i.e in j2se API not in J2ee API. This Class contains the method forName(). By using this method you can load the driver.
ok thanks to everybody!!