2 Replies Latest reply on Feb 23, 2016 5:38 AM by El Arbi Abou

    Jboss CLI if statement

    El Arbi Abou Newbie

      Hi,

      I'm trying to create a jdbc-driver and a datasource using CLI commands. But my commands syntax is not behaving as I've expected.

       

      jboss-cli.bat --commands="connect, if (result.outcome != success) of /subsystem=datasources/jdbc-driver=mysql:read-resource, /subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql), end-if"

       

      It does not creating anything ! even if the return of /subsystem=datasources/jdbc-driver=mysql:read-resource is "failed"

       

      But if I do this :

      jboss-cli.bat --commands="connect, /subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql)"

      it prints :

      {"outcome" => "success"}

       

      And creates the jdbc driver !

      Same pb with:  if (result.outcome != success) of /subsystem=datasources/data-source=MySQLDS:read-resource ....

       

      Any idea ?

       

      Thanks