I have attached a patch (https://issues.apache.org/jira/secure/attachment/12623745/0001-KARAF-2692.patch) which extends the JdbcService with a method datasourceFiles which returns the names of all deployed datasource files (with the pattern datasource-<name>.xml). The new completer retrieves from each file name the <name> part and provides it for the StringCompleter.

karaf@root()> jdbc:datasources
Name        | Product      | Version              | URL
--------------------------------------------------------------------
/jdbc/test2 | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test2
/jdbc/test3 | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test3
/jdbc/test1 | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test1
karaf@root()>
karaf@root()> jdbc:delete test
test1   test2   test3
karaf@root()> jdbc:delete test3
karaf@root()> jdbc:datasources
Name        | Product      | Version              | URL
--------------------------------------------------------------------
/jdbc/test2 | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test2
/jdbc/test1 | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test1


Regards
Krzysztof


On 17.01.2014 21:06, Krzysztof Sobkowiak wrote:
I have filled https://issues.apache.org/jira/browse/KARAF-2692 for this issue

On 17.01.2014 20:41, Krzysztof Sobkowiak wrote:
Hi

I have created a derby data source using

karaf@root()> jdbc:create -t derby -u test -i test
karaf@root()> jdbc:create -t derby -u test -i test1

karaf@root()> jdbc:datasources
Name       | Product      | Version              | URL
------------------------------------------------------------------
/jdbc/test | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test
/jdbc/test1 | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test1


When I try to delete the data source using jdbc:delete, the completer shows me the available data sources as jndi names

karaf@root()> jdbc:delete /jdbc/test
/jdbc/test    /jdbc/test1

But che command does not accept the jndi names only names used when creating the data source

karaf@root()> jdbc:delete /jdbc/test
Error executing command: The JDBC datasource file /home/kso/work/projects/asf/karaf/assemblies/apache-karaf/target/apache-karaf-3.0.1-SNAPSHOT/deploy/datasource-/jdbc/test.xml doesn't exist

karaf@root()> jdbc:delete test

The completer should display the names or the command should be able to handle correctly the jndi name.

Regards
Krzysztof

--
Krzysztof Sobkowiak

JEE & OSS Architect | Technical Architect @ Capgemini
Capgemini <http://www.pl.capgemini.com/> | Software Solutions Center <http://www.pl.capgemini-sdm.com/> | Wroclaw e-mail: [email protected] <mailto:[email protected]> | Twitter: @KSobkowiak


--
Krzysztof Sobkowiak

JEE & OSS Architect | Technical Architect @ Capgemini
Capgemini <http://www.pl.capgemini.com/> | Software Solutions Center <http://www.pl.capgemini-sdm.com/> | Wroclaw e-mail: [email protected] <mailto:[email protected]> | Twitter: @KSobkowiak


--
Krzysztof Sobkowiak

JEE & OSS Architect | Technical Architect @ Capgemini
Capgemini <http://www.pl.capgemini.com/> | Software Solutions Center <http://www.pl.capgemini-sdm.com/> | Wroclaw e-mail: [email protected] <mailto:[email protected]> | Twitter: @KSobkowiak

Reply via email to