[
https://issues.apache.org/jira/browse/KARAF-6014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692889#comment-16692889
]
Grzegorz Grzybek commented on KARAF-6014:
-----------------------------------------
Finally, both ID and name can be used for {{jdbc:query}}, {{jdbc:execute}},
{{jdbc:ds-info}} commands:
{noformat}
karaf@root()> jdbc:query 112 "show databases"
Database
──────────────────
information_schema
mysql
performance_schema
karaf@root()> jdbc:query 114 "show databases"
Database
──────────────────
information_schema
mysql
performance_schema
karaf@root()> jdbc:query 115 "show databases"
Error executing command: No JDBC datasource found for 115
karaf@root()> jdbc:query test "show databases"
Database
──────────────────
information_schema
mysql
performance_schema
{noformat}
{noformat}
karaf@root()> jdbc:ds-info test
Property │ Value
───────────────┼────────────────────────────────────
driver.version │ 1.5.9
service.id │ 112
db.version │ 10.3.5-MariaDB-10.3.5+maria~jessie
name │ test
db.product │ MySQL
url │ jdbc:mariadb://127.0.0.1:3306/mysql
driver.name │ MariaDB connector/J
username │ root
karaf@root()> jdbc:ds-info 112
Property │ Value
───────────────┼────────────────────────────────────
driver.version │ 1.5.9
service.id │ 112
db.version │ 10.3.5-MariaDB-10.3.5+maria~jessie
name │ test
db.product │ MySQL
url │ jdbc:mariadb://127.0.0.1:3306/mysql
driver.name │ MariaDB connector/J
username │ root
karaf@root()> jdbc:ds-info 115
Error executing command: No JDBC datasource found for 115
{noformat}
> Improve jdbc:* commands
> -----------------------
>
> Key: KARAF-6014
> URL: https://issues.apache.org/jira/browse/KARAF-6014
> Project: Karaf
> Issue Type: Improvement
> Affects Versions: 4.2.1
> Reporter: Grzegorz Grzybek
> Assignee: Grzegorz Grzybek
> Priority: Major
> Fix For: 4.2.2
>
>
> {{jdbc:*}} commands do not work well when there are multiple instances of:
> * {{org.osgi.service.jdbc.DataSourceFactory}}
> * {{javax.sql.DataSource}}
> This is caused partially by pax-jdbc itself, where:
> * {{pax-jdbc}} bundle registers {{DataSourceFactory}} for each driver class
> specified in {{/META-INF/services/java.sql.Driver}} of jdbc driver bundle
> * e.g., {{pax-jdbc-mariadb}} registers the same {{DataSourceFactory}}
> instance with different names: {{mariadb}} and {{mysql}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)