Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#forName%28java.lang.String%29" rel="noreferrer"><code>Class.forName()</code></a> is not directly related to JDBC at all. It simply loads a class.</p> <p>Most JDBC Driver classes register themselves in their static initializers by calling <a href="http://download.oracle.com/javase/6/docs/api/java/sql/DriverManager.html#registerDriver%28java.sql.Driver%29" rel="noreferrer"><code>registerDriver()</code></a>.</p> <p><code>registerDriver()</code> is the real call that you hardly ever need to call yourself (unless you write your own JDBC driver).</p> <p>Note that in JDBC 4 you should not need <em>either of those</em> if your JDBC driver is up-to-date, as drivers can be found using the service location mechanisms instead (i.e. simply leave out that call and open your connection as usual). See the <a href="http://download.oracle.com/javase/6/docs/api/java/sql/DriverManager.html" rel="noreferrer">documentaton of <code>DriverManager</code></a> for details:</p> <blockquote> <p>The DriverManager methods <code>getConnection</code> and <code>getDrivers</code> have been enhanced to support the Java Standard Edition Service Provider mechanism. JDBC 4.0 Drivers must include the file <code>META-INF/services/java.sql.Driver</code>. This file contains the name of the JDBC drivers implementation of <code>java.sql.Driver</code>. For example, to load the <code>my.sql.Driver</code> class, the <code>META-INF/services/java.sql.Driver</code> file would contain the entry:</p> <pre><code>my.sql.Driver </code></pre> <p>Applications no longer need to explictly load JDBC drivers using <code>Class.forName()</code>. Existing programs which currently load JDBC drivers using <code>Class.forName()</code> will continue to work without modification.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload