-
Sub-task
-
Resolution: Unresolved
-
Major
-
2.17.0.Final
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 { }