title: set the classpath in order to connect between mysql to jdbc
body: <p>I use the programs: eclipse and mysql.</p>
  
  <p>I have a database in mysql and I want to connect between the eclipse to the mysql.</p>
  
  <p>I have some folders in my project that I created in the eclipse.</p>
  
  <p>I have the main folder: testest.. and I show you what I have in the relevant folders:</p>
  
  <pre><code>testest
  ..src
  ....testest
  ......testestservlet.java
  ..app engine sdk
  ..JRE system library
  ..referenced library
  ..war
  ..lib
  ....mysql-connector-java-5.1.22
  </code></pre>
  
  <p>I updated my testestservlet.java:</p>
  
  <pre><code>package testest;
  
  import java.io.IOException;
  import javax.servlet.http.*;
  import java.sql.*;
  
  @SuppressWarnings("serial")
  public class TestestServlet extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
          throws IOException {
        resp.setContentType("text/plain");
        resp.getWriter().println("Hey, world");
        resp.getWriter().println("MySQL Connect Example.");
        Connection conn = null;
        String url = "jdbc:mysql://localhost:3306/";
        String dbName = "database_alon";
        String driver = "com.mysql.jdbc.Driver";
        String userName = "root"; 
        String password = "ADMINALON";
        try {
            Class.forName(driver).newInstance();
            conn = DriverManager.getConnection(url+dbName,userName,password);
            resp.getWriter().println("Connected to the database");
            conn.close();
            resp.getWriter().println("Disconnected from database");
        } catch (Exception e) {
            e.printStackTrace(); 
        }
    }
  }
  </code></pre>
  
  <p>now, I run testest by run as->web application.</p>
  
  <p>enter the url: localhost:8888</p>
  
  <p>and only see the 'hello world'.</p>
  
  <p>I read about that and see that I need to write the command:</p>
  
  <pre><code>set CLASSPATH=%CLASSPATH%;JAVA_HOME\lib;
  </code></pre>
  
  <p>but what are the url-s of my CLASSPATH and JAVA_HOME should be? I have folders of: c:/program_fils/java
  and: c:/Jconnector (something like that).</p>
  
  <p>the folder of Jconnector contains a file of: mysql-connector-java-5.1.22.jar</p>
  
  <p>I tried to add the JAR into the libraries via the eclipse (right click on testest->properties->Libraries->add external jar->mysql-connector-java-5.1.22-bin.jar:</p>
  
  <p><img src="https://i.stack.imgur.com/6p3jt.jpg" alt="enter image description here"></p>
  
  <p>p.s, my operating system is windows 32bit.</p>