new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java
private void createJdbcDataSource(String dsName, String user, String password, int mySQLNodePort) {

    try {
      String jdbcDsUrl = "jdbc:mysql://" + K8S_NODEPORT_HOST + ":" + mySQLNodePort;

      // create a temporary WebLogic domain property file
      File domainPropertiesFile = File.createTempFile("domain", "properties");
      Properties p = new Properties();
      p.setProperty("admin_host", K8S_NODEPORT_HOST);
      p.setProperty("admin_port", Integer.toString(t3ChannelPort));
      p.setProperty("admin_username", ADMIN_USERNAME_DEFAULT);
      p.setProperty("admin_password", ADMIN_PASSWORD_DEFAULT);
      p.setProperty("dsName", dsName);
      p.setProperty("dsUrl", jdbcDsUrl);
      p.setProperty("dsDriver", "com.mysql.cj.jdbc.Driver");
      p.setProperty("dsUser", user);
      p.setProperty("dsPassword", password);
      p.setProperty("dsTarget", clusterName);
      p.store(new FileOutputStream(domainPropertiesFile), "domain properties file");

      // WLST script for creating jdbc datasource
      Path wlstScript = Paths.get(RESOURCE_DIR, "python-scripts", "create-jdbc-resource.py");
      executeWLSTScript(wlstScript, domainPropertiesFile.toPath(), domainNamespace);
    } catch (IOException ex) {
      logger.severe(ex.getMessage());
    }
  }
//create a JDBC datasource targeted to cluster.
create a JDBC datasource targeted to cluster.
create a JDBC datasource targeted to cluster .
private void createJdbcDataSource(String dsName, String user, String password, int mySQLNodePort) {
    try {
      String jdbcDsUrl = "jdbc:mysql://" + K8S_NODEPORT_HOST + ":" + mySQLNodePort;
      File domainPropertiesFile = File.createTempFile("domain", "properties");
      Properties p = new Properties();
      p.setProperty("admin_host", K8S_NODEPORT_HOST);
      p.setProperty("admin_port", Integer.toString(t3ChannelPort));
      p.setProperty("admin_username", ADMIN_USERNAME_DEFAULT);
      p.setProperty("admin_password", ADMIN_PASSWORD_DEFAULT);
      p.setProperty("dsName", dsName);
      p.setProperty("dsUrl", jdbcDsUrl);
      p.setProperty("dsDriver", "com.mysql.cj.jdbc.Driver");
      p.setProperty("dsUser", user);
      p.setProperty("dsPassword", password);
      p.setProperty("dsTarget", clusterName);
      p.store(new FileOutputStream(domainPropertiesFile), "domain properties file");
      Path wlstScript = Paths.get(RESOURCE_DIR, "python-scripts", "create-jdbc-resource.py");
      executeWLSTScript(wlstScript, domainPropertiesFile.toPath(), domainNamespace);
    } catch (IOException ex) {
      logger.severe(ex.getMessage());
    }
  }
private void createJdbcDataSource ( String dsName , String user , String password , int mySQLNodePort ) { try { String jdbcDsUrl = "jdbc:mysql://" + K8S_NODEPORT_HOST + ":" + mySQLNodePort ; File domainPropertiesFile = File . createTempFile ( "domain" , "properties" ) ; Properties p = new Properties ( ) ; p . setProperty ( "admin_host" , K8S_NODEPORT_HOST ) ; p . setProperty ( "admin_port" , Integer . toString ( t3ChannelPort ) ) ; p . setProperty ( "admin_username" , ADMIN_USERNAME_DEFAULT ) ; p . setProperty ( "admin_password" , ADMIN_PASSWORD_DEFAULT ) ; p . setProperty ( "dsName" , dsName ) ; p . setProperty ( "dsUrl" , jdbcDsUrl ) ; p . setProperty ( "dsDriver" , "com.mysql.cj.jdbc.Driver" ) ; p . setProperty ( "dsUser" , user ) ; p . setProperty ( "dsPassword" , password ) ; p . setProperty ( "dsTarget" , clusterName ) ; p . store ( new FileOutputStream ( domainPropertiesFile ) , "domain properties file" ) ; Path wlstScript = Paths . get ( RESOURCE_DIR , "python-scripts" , "create-jdbc-resource.py" ) ; executeWLSTScript ( wlstScript , domainPropertiesFile . toPath ( ) , domainNamespace ) ; } catch ( IOException ex ) { logger . severe ( ex . getMessage ( ) ) ; } }
create a JDBC datasource targeted to cluster.
create a JDBC datasource targeted to cluster .
// create a temporary WebLogic domain property file // WLST script for creating jdbc datasource