title: How to specify jdbc/DataSource?
body: <p>I'm trying to make a connection to an oracle database using the sample codes like this:</p>
  
  <pre><code>public static Connection getConnection() throws ClassNotFoundException {
      Class.forName("oracle.jdbc.driver.OracleDriver");
      Properties env = new Properties();
      //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
      env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
      env.put(Context.PROVIDER_URL, "ldap://192.168.1.1:389/o=myo,dc=mydc,dc=us");
      Connection connection = null;
  
      try {
          InitialContext context = new InitialContext(env);
          DataSource dataSource = (DataSource) context.lookup("jdbc/DataSource");
          connection = dataSource.getConnection();
      } catch (NamingException e) {
          e.printStackTrace();
      } catch (SQLException e) {
          e.printStackTrace();
      }
  
      return connection;
  }
  </code></pre>
  
  <p>But it always throw exception like this:</p>
  
  <pre><code>javax.naming.InvalidNameException: jdbc: [LDAP: error code 34 - invalid DN]; remaining name 'jdbc/DataSource'
  </code></pre>
  
  <p>Where and how should i specify that jdbc/DataSource?</p>
  
  <p>I'm confused as I was given a working project using codes similar as above but nowhere tells what DataSource is. 
  I'm wondering if jdbc/DataSource should be a DN in LDAP, but I find nothing seem relavent in my given ldap data. Sorry if that question is stupid or not make sense, i'm new to that all stuff.</p>
  
  <p>Thanks!</p>