title: Connecting to oracle database located remotely
body: <p>I am trying to run following code which is connecting to remote database and retrieving records:</p>
  
  <pre><code>   import java.sql.*;
  
     class Employee
     {
       public static void main (String args [])
        throws SQLException, ClassNotFoundException {
      // Load the Oracle JDBC driver
       Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
  
     // Connect to the database
      // You must put a database name after the @ sign in the connection URL.
      // You can use either the fully specified SQL*net syntax or a short cut
      // syntax as &lt;host&gt;:&lt;port&gt;:&lt;sid&gt;.  The example uses the short cut syntax.
      Connection conn = DriverManager.getConnection  ("jdbc:oracle:thin:@ourcompany.com:1521:course", "username", "password");
  
  // Create a Statement
  Statement stmt = conn.createStatement ();
  
  // Select the ENAME column from the EMP table
  ResultSet rset = stmt.executeQuery ("select * from test");
  
  // Iterate through the result and print the employee names
  /*
  while (rset.next ())
    System.out.println (rset.getString ("name"));
    System.out.println (rset.getString ("id"));
    */
    rset.next();
    System.out.println(rset.getString("name"));
  </code></pre>
  
  <p>}
  }</p>
  
  <p>after running this code from Netbeans i am getting an error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@ourcompany.com:1521:course
        at java.sql.DriverManager.getConnection(DriverManager.java:604)
        at java.sql.DriverManager.getConnection(DriverManager.java:221)
        at Employee.main(Emplyoee.java:23)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)</p>
  </blockquote>
  
  <p>I have downloaded ojdbc14.jar and kept in C:\Program Files\Java\jdk1.7.0\jre\lib path.
  I do not know where i am going wrong?...plz help me here.</p>