title: making jdbc connection to oracle apex db
body: <p>I am trying to connect to oracle apex database. I have ojdbc.jar in my classpath. Here is my sample code for this.</p>
  
  <pre><code>  public class ConnectionDAO {
      String database = "demo";
      String user = "myusername";
      String password = "somepwd";
      String host = "https://apex.oracle.com/"; // By default
      String port ="8086";
      private Connection con;
  
      public Connection connect() {
          try {
  
              Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
  
              con = DriverManager.getConnection("jdbc:oracle:thin:@//" + host + ":" + port +"/"+database+"?user="+user+"&amp;password="+password);
              //con = DriverManager.getConnection("jdbc:oracle://" + host + "/"
                  //  + database + "?user=" + user + "&amp;password=" + password);
              // Set connectionStatus
              System.out.println("Connected");
  
              return con;
          } catch (Exception E) {
              System.out.println("Not Connected");
              E.printStackTrace();
              return null;
          }
      }
  
  
  }
  </code></pre>
  
  <p>But it is giving  the following exception</p>
  
  <pre><code>java.sql.SQLException: invalid arguments in call
  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
  at oracle.jdbc.driver.PhysicalConnection.&lt;init&gt;(PhysicalConnection.java:414)
  at oracle.jdbc.driver.T4CConnection.&lt;init&gt;(T4CConnection.java:165)
  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
  at java.sql.DriverManager.getConnection(DriverManager.java:571)
  at java.sql.DriverManager.getConnection(DriverManager.java:233)
  at com.lister.dao.ConnectionDAO.connect(ConnectionDAO.java:19)
  at com.lister.quiz.Test.main(Test.java:8)
  </code></pre>
  
  <p>I am new to oracle apex. I browsed about it but did not get the satisfactory solution. Any help will be appreciated.</p>