title: Why I obtain this SQLException (No suitable driver) when I try to create a Connection object for an Oracle database?
body: <p>I have to create a very simple batch Java application (an application that run into shell) and that perform some query on an <strong>Oracle</strong> database using <strong>JDBC</strong> and I never done it.</p>
  
  <p>I am following this tutorial: <a href="http://www.ntu.edu.sg/home/ehchua/programming/java/JDBC_Basic.html" rel="nofollow">http://www.ntu.edu.sg/home/ehchua/programming/java/JDBC_Basic.html</a></p>
  
  <p>So I have done in this way to allocate a new <strong>Connection</strong> object for my application:</p>
  
  <pre><code>import java.sql.*;
  
  public class Main {
  
      public static void main(String[] args) {
          System.out.println("Hello World !!!");
  
          String partitaIVA = args[0];
          String nomePDF = args[1];
  
          Connection conn = null;
          Statement  stmt = null;
  
          try {
              // Step 1: Allocate a database "Connection" object
              conn = DriverManager.getConnection("jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:eme1", "myUserName", "myPswd"); // Oracle DB
  
          } catch(SQLException ex) {
              ex.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>The problem is that when I run the application it seems that the <strong>SQLException</strong> is thrown because enter into the <strong>catch</strong> block and print the following error message in the console:</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:eme1
      at java.sql.DriverManager.getConnection(DriverManager.java:602)
      at java.sql.DriverManager.getConnection(DriverManager.java:185)
      at Main.main(Main.java:16)
  </code></pre>
  
  <p>Why? What cause this problem and how can I fix this issue? What am I missing?</p>
  
  <p>Tnx</p>