title: How to link JDBC driver to EJB project missing WEB-INF folder
body: <p>I have Enterprise Appilcation Solution in Neon Eclipse, which envelope EJB and Servlet projects and deployed to Wildfly 10 server.<br>
  Servlet calls EJB for access DB.<br>
  If I put JDBC driver in WEB-INF folder of Servlet project, all is going well, but if I move the code to EJB and link the driver as external JAR (see screenshot), I get error:  </p>
  
  <pre><code> java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from [Module "deployment.NeoflexBank.ear.Neoflex.jar:main" from Service Module Loader]
  </code></pre>
  
  <p>Here is the code I use for access the DB:  </p>
  
  <pre><code>    public String test() {
          String output = "";
  
          try {
              Class.forName("com.mysql.jdbc.Driver").newInstance();
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          String url="jdbc:mysql://localhost:3306/neoflex";
          String username="root";
          String password="";
          String query="select * from clients";
          Connection conn;
          try {
              conn = (Connection) DriverManager.getConnection(url, username, password);
              Statement stmt = (Statement) conn.createStatement();
              ResultSet rs = stmt.executeQuery(query);
  
              while(rs.next())
              {
                  output += rs.getInt("id");
                  output += rs.getString("username");
                  output += rs.getString("birth_date");
                  output += rs.getString("name");
                  output += rs.getString("surename");
              }
          } catch (SQLException e) {
              // TODO Auto-generated catch block
              return e.toString();
          }
  
          return output;
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/EPAc9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EPAc9.jpg" alt="Troubles on JDBC linking"></a></p>