Skip to main content
Tyler_Stevens_637
Participant
December 8, 2016
Question

ColdFusion 11 Datasource Using Oracle Wallets/PKI

  • December 8, 2016
  • 1 reply
  • 1518 views

ColdFusion v11,0,10,300066

Oracle v12.01.00.02

Has anyone worked with setting up Oracle datasources utilizing Oracle Wallets?  cwallet.sso? Auto login.  I have successfully implemented it in Java applications where I am able to create and provide a set of properties to the JDBC connection method, in addition to some other configuration. The CFIDE Administrator Data Sources GUI does not appear to give me the option to implement Wallets.  Is there a way to configure them directly? 

Any help would be greatly appreciated!

Thanks!

    This topic has been closed for replies.

    1 reply

    Participant
    December 9, 2016

    If the built-in ColdFusion drivers don't have the option you're looking for but there is a JDBC driver that allows the connection, you can use it directly.  First, in "Server Settings" → "Java and JVM", add the ".jar" file(s) for the driver to the "ColdFusion Class path" field. If the driver requires any system properties, add those to "JVM Arguments" as well.  Restart the server.  Go back to "Data & Services" → "Data Sources".  Create an "other" data source; the fields on that screen should be self-explanatory.

    Tyler_Stevens_637
    Participant
    December 9, 2016

    Thanks for responding!  The issue I with that is the java properties vary by datasource and I have multiple datasources.  I have added the necessary Oracle jars to the CF Classpath.  I also added the "oracle.net.authentication_services" and "javax.net.ssl.keyStoreType" properties to the JVM Arguments.  I updated the java.security file to add the Oracle PKI Provider in the correct location manually.  I need the ability to point each datasource to a different Oracle Wallet.  Any ideas?  Thanks!

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Security.insertProviderAt(new oracle.security.pki.OraclePKIProvider(), 3);
    String url = "jdbc:oracle:thin:@(DESCRIPTION = " +
    "(ADDRESS_LIST = " +
    "(ADDRESS = " +
    "(PROTOCOL = TCPS)" +
    "(HOST = XX.XXXX.XXX.XXX)" +
    "(PORT = XXXX)" +
    ")" +
    ") " +
    "(CONNECT_DATA = (SERVICE_NAME = DBSID))" +
    ")";

    java.util.Properties info = new java.util.Properties();
    info.setProperty("oracle.net.authentication_services", "(TCPS)");
    info.setProperty("javax.net.ssl.trustStore", "C:/example/cwallet1.sso");
    info.setProperty("javax.net.ssl.trustStoreType", "SSO");
    info.setProperty("javax.net.ssl.keyStore", "C:/example/cwallet1.sso");
    info.setProperty("javax.net.ssl.keyStoreType", "SSO");

    Connection conn = DriverManager.getConnection(url, info);
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select user from dual");

    Tyler_Stevens_637
    Participant
    December 14, 2016

    I was able to configure datasources in the underlying Tomcat server and create JNDI Datasources in CF Administrator.  Everything connects fine.  The code in CFQUERY runs find but CFPROCPARAM calls result in "Missing IN or OUT parameter at index: n" ORA-17041 errors.  The n is always one more than the number of parameters that are required for the stored procedure. ColdFusion code should work the same regardless of the Datasource used?!?!  Especially when they are both using JDBC against the same Oracle database. If anyone has any insight on this it would be greatly appreciated. -Thanks