Details

    Description

      It would be good to have a command to quickly add a new DatasourceDefinition :

      jpa-add-datasource-definition --named java:global/MyApp/myDS --className org.apache.derby.jdbc.ClientDataSource --port 1527 --server localhost -dbName testDB --user scott --password tiger
      

      This will create a new class called org.myproject.DatasourceResources if it doesn't exist, and will add a new DatasourceDefinition :

      package org.myproject;
      
      @DatasourceDefinitions({
            @DatasourceDefinition(
                 name = "java:global/MyApp/myDS",
                 className = "org.apache.derby.jdbc.ClientDataSource",
                 portNumber = 1527,
                 serverName = "localhost",
                 databaseName = "testDB",
                 user = "lance",
                 password = "secret"
              )
      })
      public class DatasourceResources {
      } 
      

      Tying the command a second time will add a new DatasourceDefinition to the exiting DatasourceDefinitions :

      package org.myproject;
      
      package org.myproject;
      
      @DatasourceDefinitions({
            @DatasourceDefinition(
                 name = "java:global/MyApp/myDS",
                 className = "org.apache.derby.jdbc.ClientDataSource",
                 portNumber = 1527,
                 serverName = "localhost",
                 databaseName = "testDB",
                 user = "lance",
                 password = "secret"
              ),
            @DatasourceDefinition(
                  ...
                  )
      })
      public class DatasourceResources {
      } 
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            agoncal Antonio Goncalves (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: