MySQL driver installed but getConnection throws No suitable driver found
<p>I have a fresh installed <em>Wildfly 10 application server</em> running in <em>standalone</em> mode. I need to deploy a project requiring the MySQL JDBC driver.
I installed the driver following the tutorial found at <a href="http://hpehl.info/jdbc-driver-setup.html" rel="nofollow">JDBC Driver Setup</a> (I have chosen the module installation). After restarting WildFly, in <strong>console.log</strong> I read:</p>

<blockquote>
  <p>INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService
  Thread Pool -- 33) WFLYJCA0005: Deploying non-JDBC-compliant driver
  class com.mysql.jdbc.Driver (version 5.1)
  INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6)
  WFLYJCA0018: Started Driver service with driver-name = mysql</p>
</blockquote>

<p>It seems all good, but I can't get a connection for the database.
I'm using this piece of code:</p>

<pre><code>Class.forName("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/dbName?user=someUser&amp;password=somePass");
</code></pre>

<p>The first line throws the exception:</p>

<blockquote>
  <p>com.mysql.jdbc.Driver from [Module
  "deployment.someProject-1.0.0.war:main
  from Service Module Loader]"</p>
</blockquote>

<p>If I comment out the first line, I get <em>No suitable driver exception</em>.</p>

<p>Do you have any idea? Thanks in advice</p>