You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Krzysztof Sobkowiak (JIRA)" <ji...@apache.org> on 2014/01/18 00:20:22 UTC

[jira] [Comment Edited] (KARAF-2692) The completer of jdbc:delete shows jndi names but the command can not handle them

    [ https://issues.apache.org/jira/browse/KARAF-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13875371#comment-13875371 ] 

Krzysztof Sobkowiak edited comment on KARAF-2692 at 1/17/14 11:19 PM:
----------------------------------------------------------------------

The patch 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.

{code}
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
{code}


was (Author: sobkowiak):
The patch extends the JdbcService wit 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.

{code}
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
{code}

> The completer of jdbc:delete shows jndi names but the command can not handle them
> ---------------------------------------------------------------------------------
>
>                 Key: KARAF-2692
>                 URL: https://issues.apache.org/jira/browse/KARAF-2692
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-feature
>    Affects Versions: 3.0.0
>            Reporter: Krzysztof Sobkowiak
>              Labels: datasource, jdbc
>         Attachments: 0001-KARAF-2692.patch
>
>
> I have created a derby data source using
> {code}
> 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
> {code}
> When I try to delete the data source using jdbc:delete, the completer shows me the available data sources as jndi names
> {code}
> karaf@root()> jdbc:delete /jdbc/test
> /jdbc/test    /jdbc/test1 
> {code}
> But che command does not accept the jndi names only names used when creating the data source
> {code}
> 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
> {code}
> The completer should display the names or the command should be able to handle correctly the jndi name.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)