You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/04/11 19:20:25 UTC
[03/33] git commit: [KARAF-2852] Merge jdbc/core and jdbc/command
[KARAF-2852] Merge jdbc/core and jdbc/command
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/a9b763f2
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/a9b763f2
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/a9b763f2
Branch: refs/heads/master
Commit: a9b763f2b759d0d018697cdac0f21f4a09445b5b
Parents: 0f53437
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Fri Apr 11 08:38:47 2014 +0200
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Fri Apr 11 19:20:02 2014 +0200
----------------------------------------------------------------------
.../enterprise/src/main/feature/feature.xml | 1 -
jdbc/NOTICE | 71 ++++++
jdbc/command/NOTICE | 71 ------
jdbc/command/pom.xml | 87 -------
.../karaf/jdbc/command/CreateCommand.java | 61 -----
.../karaf/jdbc/command/DataSourcesCommand.java | 50 ----
.../karaf/jdbc/command/DeleteCommand.java | 39 ----
.../karaf/jdbc/command/ExecuteCommand.java | 42 ----
.../apache/karaf/jdbc/command/InfoCommand.java | 53 -----
.../karaf/jdbc/command/JdbcCommandSupport.java | 36 ---
.../apache/karaf/jdbc/command/QueryCommand.java | 64 -----
.../karaf/jdbc/command/TablesCommand.java | 61 -----
.../DataSourcesFileNameCompleter.java | 59 -----
.../completers/DataSourcesNameCompleter.java | 59 -----
.../src/main/resources/OSGI-INF/bundle.info | 26 ---
jdbc/core/NOTICE | 71 ------
jdbc/core/pom.xml | 87 -------
.../java/org/apache/karaf/jdbc/JdbcMBean.java | 96 --------
.../java/org/apache/karaf/jdbc/JdbcService.java | 95 --------
.../karaf/jdbc/internal/JdbcConnector.java | 146 ------------
.../karaf/jdbc/internal/JdbcMBeanImpl.java | 168 --------------
.../karaf/jdbc/internal/JdbcServiceImpl.java | 231 -------------------
.../resources/OSGI-INF/blueprint/jdbc-core.xml | 41 ----
.../src/main/resources/OSGI-INF/bundle.info | 18 --
.../karaf/jdbc/internal/datasource-db2.xml | 32 ---
.../karaf/jdbc/internal/datasource-derby.xml | 39 ----
.../karaf/jdbc/internal/datasource-generic.xml | 141 -----------
.../karaf/jdbc/internal/datasource-h2.xml | 31 ---
.../karaf/jdbc/internal/datasource-hsql.xml | 31 ---
.../karaf/jdbc/internal/datasource-mssql.xml | 32 ---
.../karaf/jdbc/internal/datasource-mysql.xml | 31 ---
.../karaf/jdbc/internal/datasource-oracle.xml | 31 ---
.../karaf/jdbc/internal/datasource-postgres.xml | 34 ---
jdbc/pom.xml | 71 +++++-
.../java/org/apache/karaf/jdbc/JdbcMBean.java | 96 ++++++++
.../java/org/apache/karaf/jdbc/JdbcService.java | 95 ++++++++
.../karaf/jdbc/command/CreateCommand.java | 61 +++++
.../karaf/jdbc/command/DataSourcesCommand.java | 50 ++++
.../karaf/jdbc/command/DeleteCommand.java | 39 ++++
.../karaf/jdbc/command/ExecuteCommand.java | 42 ++++
.../apache/karaf/jdbc/command/InfoCommand.java | 53 +++++
.../karaf/jdbc/command/JdbcCommandSupport.java | 36 +++
.../apache/karaf/jdbc/command/QueryCommand.java | 64 +++++
.../karaf/jdbc/command/TablesCommand.java | 61 +++++
.../DataSourcesFileNameCompleter.java | 59 +++++
.../completers/DataSourcesNameCompleter.java | 59 +++++
.../karaf/jdbc/internal/JdbcConnector.java | 146 ++++++++++++
.../karaf/jdbc/internal/JdbcMBeanImpl.java | 168 ++++++++++++++
.../karaf/jdbc/internal/JdbcServiceImpl.java | 231 +++++++++++++++++++
.../resources/OSGI-INF/blueprint/jdbc-core.xml | 41 ++++
jdbc/src/main/resources/OSGI-INF/bundle.info | 18 ++
.../karaf/jdbc/internal/datasource-db2.xml | 32 +++
.../karaf/jdbc/internal/datasource-derby.xml | 39 ++++
.../karaf/jdbc/internal/datasource-generic.xml | 141 +++++++++++
.../karaf/jdbc/internal/datasource-h2.xml | 31 +++
.../karaf/jdbc/internal/datasource-hsql.xml | 31 +++
.../karaf/jdbc/internal/datasource-mssql.xml | 32 +++
.../karaf/jdbc/internal/datasource-mysql.xml | 31 +++
.../karaf/jdbc/internal/datasource-oracle.xml | 31 +++
.../karaf/jdbc/internal/datasource-postgres.xml | 34 +++
60 files changed, 1855 insertions(+), 2072 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/assemblies/features/enterprise/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/assemblies/features/enterprise/src/main/feature/feature.xml b/assemblies/features/enterprise/src/main/feature/feature.xml
index c68017f..24c4136 100644
--- a/assemblies/features/enterprise/src/main/feature/feature.xml
+++ b/assemblies/features/enterprise/src/main/feature/feature.xml
@@ -190,7 +190,6 @@
<bundle>mvn:commons-pool/commons-pool/${commons-pool.version}</bundle>
<bundle>mvn:commons-dbcp/commons-dbcp/${commons-dbcp.version}</bundle>
<bundle>mvn:org.apache.karaf.jdbc/org.apache.karaf.jdbc.core/${project.version}</bundle>
- <bundle>mvn:org.apache.karaf.jdbc/org.apache.karaf.jdbc.command/${project.version}</bundle>
</feature>
<feature name="jms" description="JMS service and commands" version="${project.version}" resolver="(obr)">
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/NOTICE
----------------------------------------------------------------------
diff --git a/jdbc/NOTICE b/jdbc/NOTICE
new file mode 100644
index 0000000..b70f1f9
--- /dev/null
+++ b/jdbc/NOTICE
@@ -0,0 +1,71 @@
+Apache Karaf
+Copyright 2010-2014 The Apache Software Foundation
+
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+OW2 (http://www.ow2.org/).
+Licensed under the BSD License.
+
+This product includes software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software developed at
+Eclipse Foundation (http://www.eclipse.org/).
+Licensed under the EPL.
+
+This product includes software written by
+Antony Lesuisse.
+Licensed under Public Domain.
+
+
+II. Used Software
+
+This product uses software developed at
+FUSE Source (http://www.fusesource.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+AOP Alliance (http://aopalliance.sourceforge.net/).
+Licensed under the Public Domain.
+
+This product uses software developed at
+Tanuki Software (http://www.tanukisoftware.com/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+Jasypt (http://jasypt.sourceforge.net/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+JLine (http://jline.sourceforge.net).
+Licensed under the BSD License.
+
+This product uses software developed at
+SLF4J (http://www.slf4j.org/).
+Licensed under the MIT License.
+
+This product uses software developed at
+SpringSource (http://www.springsource.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software from http://www.json.org.
+Copyright (c) 2002 JSON.org
+
+
+III. License Summary
+- Apache License 2.0
+- BSD License
+- EPL License
+- MIT License
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/NOTICE
----------------------------------------------------------------------
diff --git a/jdbc/command/NOTICE b/jdbc/command/NOTICE
deleted file mode 100644
index b70f1f9..0000000
--- a/jdbc/command/NOTICE
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Karaf
-Copyright 2010-2014 The Apache Software Foundation
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-OW2 (http://www.ow2.org/).
-Licensed under the BSD License.
-
-This product includes software developed at
-OPS4J (http://www.ops4j.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the EPL.
-
-This product includes software written by
-Antony Lesuisse.
-Licensed under Public Domain.
-
-
-II. Used Software
-
-This product uses software developed at
-FUSE Source (http://www.fusesource.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-AOP Alliance (http://aopalliance.sourceforge.net/).
-Licensed under the Public Domain.
-
-This product uses software developed at
-Tanuki Software (http://www.tanukisoftware.com/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-Jasypt (http://jasypt.sourceforge.net/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-JLine (http://jline.sourceforge.net).
-Licensed under the BSD License.
-
-This product uses software developed at
-SLF4J (http://www.slf4j.org/).
-Licensed under the MIT License.
-
-This product uses software developed at
-SpringSource (http://www.springsource.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
-
-III. License Summary
-- Apache License 2.0
-- BSD License
-- EPL License
-- MIT License
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/pom.xml
----------------------------------------------------------------------
diff --git a/jdbc/command/pom.xml b/jdbc/command/pom.xml
deleted file mode 100644
index b459a13..0000000
--- a/jdbc/command/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.karaf.jdbc</groupId>
- <artifactId>jdbc</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>org.apache.karaf.jdbc.command</artifactId>
- <packaging>bundle</packaging>
- <name>Apache Karaf :: JDBC :: Command</name>
- <description>This bundle provides shell commands to manipulate the JDBC service</description>
-
- <properties>
- <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.karaf.jdbc</groupId>
- <artifactId>org.apache.karaf.jdbc.core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.karaf.shell</groupId>
- <artifactId>org.apache.karaf.shell.core</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.info</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>!*</Export-Package>
- <Karaf-Commands>*</Karaf-Commands>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java
deleted file mode 100644
index 89ed49c..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Completion;
-import org.apache.karaf.shell.api.action.Option;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.support.completers.StringsCompleter;
-
-@Command(scope = "jdbc", name = "create", description = "Create a JDBC datasource")
-@Service
-public class CreateCommand extends JdbcCommandSupport {
-
- @Argument(index = 0, name = "name", description = "The JDBC datasource name", required = true, multiValued = false)
- String name;
-
- @Option(name = "-t", aliases = { "--type" }, description = "The JDBC datasource type (generic, MySQL, Oracle, Postgres, H2, HSQL, Derby, MSSQL)", required = false, multiValued = false)
- @Completion(value = StringsCompleter.class, values = { "db2", "derby", "generic", "h2", "hsql", "mysql", "oracle", "postgres", "mssql" })
- String type;
-
- @Option(name = "-d", aliases = { "--driver" }, description = "The classname of the JDBC driver to use. NB: this option is used only the type generic", required = false, multiValued = false)
- String driver;
-
- @Option(name = "-v", aliases = { "--version" }, description = "The version of the driver to use", required = false, multiValued = false)
- String version;
-
- @Option(name = "-url", description = "The JDBC URL to use", required = false, multiValued = false)
- String url;
-
- @Option(name = "-u", aliases = { "--username" }, description = "The database username", required = false, multiValued = false)
- String username;
-
- @Option(name = "-p", aliases = { "--password" }, description = "The database password", required = false, multiValued = false)
- String password;
-
- @Option(name = "-i", aliases = { "--install-bundles" }, description = "Try to install the bundles providing the JDBC driver", required = false, multiValued = false)
- boolean installBundles = false;
-
- @Override
- public Object execute() throws Exception {
- this.getJdbcService().create(name, type, driver, version, url, username, password, installBundles);
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java
deleted file mode 100644
index cb3edad..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.support.table.ShellTable;
-
-@Command(scope = "jdbc", name = "datasources", description = "List the JDBC datasources")
-@Service
-public class DataSourcesCommand extends JdbcCommandSupport {
-
- @Override
- public Object execute() throws Exception {
- ShellTable table = new ShellTable();
-
- table.column("Name");
- table.column("Product");
- table.column("Version");
- table.column("URL");
-
- List<String> datasources = this.getJdbcService().datasources();
- for (String datasource : datasources) {
- Map<String, String> info = this.getJdbcService().info(datasource);
- table.addRow().addContent(datasource, info.get("db.product"), info.get("db.version"), info.get("url"));
- }
-
- table.print(System.out);
-
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java
deleted file mode 100644
index 6bf7236..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import org.apache.karaf.jdbc.command.completers.DataSourcesFileNameCompleter;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Completion;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-
-@Command(scope = "jdbc", name = "delete", description = "Delete a JDBC datasource")
-@Service
-public class DeleteCommand extends JdbcCommandSupport {
-
- @Argument(index = 0, name = "name", description = "The JDBC datasource name (the one used at creation time)", required = true, multiValued = false)
- @Completion(DataSourcesFileNameCompleter.class)
- String name;
-
- @Override
- public Object execute() throws Exception {
- this.getJdbcService().delete(name);
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java
deleted file mode 100644
index 480ab51..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Completion;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-
-@Command(scope = "jdbc", name = "execute", description = "Execute a SQL command on a given JDBC datasource")
-@Service
-public class ExecuteCommand extends JdbcCommandSupport {
-
- @Argument(index = 0, name = "datasource", description = "The JDBC datasource", required = true, multiValued = false)
- @Completion(DataSourcesNameCompleter.class)
- String datasource;
-
- @Argument(index = 1, name = "command", description = "The SQL command to execute", required = true, multiValued = false)
- String command;
-
- @Override
- public Object execute() throws Exception {
- this.getJdbcService().execute(datasource, command);
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java
deleted file mode 100644
index e53bbab..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Completion;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.support.table.ShellTable;
-
-import java.util.Map;
-
-@Command(scope = "jdbc", name = "info", description = "Display details about a JDBC datasource")
-@Service
-public class InfoCommand extends JdbcCommandSupport {
-
- @Argument(index = 0, name = "datasource", description = "The JDBC datasource name", required = true, multiValued = false)
- @Completion(DataSourcesNameCompleter.class)
- String datasource;
-
- @Override
- public Object execute() throws Exception {
- ShellTable table = new ShellTable();
-
- table.column("Property");
- table.column("Value");
-
- Map<String, String> info = this.getJdbcService().info(datasource);
- for (String property : info.keySet()) {
- table.addRow().addContent(property, info.get(property));
- }
-
- table.print(System.out);
-
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java
deleted file mode 100644
index cf1eb58..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import org.apache.karaf.jdbc.JdbcService;
-import org.apache.karaf.shell.api.action.Action;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-
-public abstract class JdbcCommandSupport implements Action {
-
- @Reference
- private JdbcService jdbcService;
-
- public JdbcService getJdbcService() {
- return jdbcService;
- }
-
- public void setJdbcService(JdbcService jdbcService) {
- this.jdbcService = jdbcService;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java
deleted file mode 100644
index 297288b..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Completion;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.support.table.Row;
-import org.apache.karaf.shell.support.table.ShellTable;
-
-@Command(scope = "jdbc", name = "query", description = "Execute a SQL query on a JDBC datasource")
-@Service
-public class QueryCommand extends JdbcCommandSupport {
-
- @Argument(index = 0, name = "datasource", description = "The JDBC datasource to use", required = true, multiValued = false)
- @Completion(DataSourcesNameCompleter.class)
- String datasource;
-
- @Argument(index = 1, name = "query", description = "The SQL query to execute", required = true, multiValued = false)
- String query;
-
- @Override
- public Object execute() throws Exception {
- ShellTable table = new ShellTable();
-
- Map<String, List<String>> map = this.getJdbcService().query(datasource, query);
- int rowCount = 0;
- for (String column : map.keySet()) {
- table.column(column);
- rowCount = map.get(column).size();
- }
-
- for (int i = 0; i < rowCount; i++) {
- Row row = table.addRow();
- for (String column : map.keySet()) {
- row.addContent(map.get(column).get(i));
- }
- }
-
- table.print(System.out);
-
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java
deleted file mode 100644
index 04baa70..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.api.action.Argument;
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Completion;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.support.table.Row;
-import org.apache.karaf.shell.support.table.ShellTable;
-
-@Command(scope = "jdbc", name = "tables", description = "List the tables on a given JDBC datasource")
-@Service
-public class TablesCommand extends JdbcCommandSupport {
-
- @Argument(index = 0, name = "datasource", description = "The JDBC datasource to use", required = true, multiValued = false)
- @Completion(DataSourcesNameCompleter.class)
- String datasource;
-
- @Override
- public Object execute() throws Exception {
- ShellTable table = new ShellTable();
-
- Map<String, List<String>> map = this.getJdbcService().tables(datasource);
- int rowCount = 0;
- for (String column : map.keySet()) {
- table.column(column);
- rowCount = map.get(column).size();
- }
-
- for (int i = 0; i < rowCount; i++) {
- Row row = table.addRow();
- for (String column : map.keySet()) {
- row.addContent(map.get(column).get(i));
- }
- }
-
- table.print(System.out);
-
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java
deleted file mode 100644
index 8ba0fe9..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command.completers;
-
-import org.apache.karaf.jdbc.JdbcService;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.api.console.CommandLine;
-import org.apache.karaf.shell.api.console.Completer;
-import org.apache.karaf.shell.api.console.Session;
-import org.apache.karaf.shell.support.completers.StringsCompleter;
-
-import java.util.List;
-
-/**
- * Completer on the JDBC datasources file name.
- */
-@Service
-public class DataSourcesFileNameCompleter implements Completer {
-
- @Reference
- private JdbcService jdbcService;
-
- @Override
- public int complete(Session session, CommandLine commandLine, List<String> candidates) {
- StringsCompleter delegate = new StringsCompleter();
- try {
- for (String datasourceFileName : jdbcService.datasourceFileNames()) {
- delegate.getStrings().add(datasourceFileName.replace("datasource-", "").replace(".xml", ""));
- }
- } catch (Exception e) {
- // nothing to do
- }
- return delegate.complete(session, commandLine, candidates);
- }
-
- public JdbcService getJdbcService() {
- return jdbcService;
- }
-
- public void setJdbcService(JdbcService jdbcService) {
- this.jdbcService = jdbcService;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java
deleted file mode 100644
index 238910f..0000000
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.command.completers;
-
-import org.apache.karaf.jdbc.JdbcService;
-import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.api.console.CommandLine;
-import org.apache.karaf.shell.api.console.Completer;
-import org.apache.karaf.shell.api.console.Session;
-import org.apache.karaf.shell.support.completers.StringsCompleter;
-
-import java.util.List;
-
-/**
- * Completer on the JDBC datasources name (JNDI or OSGi service property).
- */
-@Service
-public class DataSourcesNameCompleter implements Completer {
-
- @Reference
- private JdbcService jdbcService;
-
- @Override
- public int complete(Session session, CommandLine commandLine, List<String> candidates) {
- StringsCompleter delegate = new StringsCompleter();
- try {
- for (String datasource : jdbcService.datasources()) {
- delegate.getStrings().add(datasource);
- }
- } catch (Exception e) {
- // nothing to do
- }
- return delegate.complete(session, commandLine, candidates);
- }
-
- public JdbcService getJdbcService() {
- return jdbcService;
- }
-
- public void setJdbcService(JdbcService jdbcService) {
- this.jdbcService = jdbcService;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/command/src/main/resources/OSGI-INF/bundle.info
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/resources/OSGI-INF/bundle.info b/jdbc/command/src/main/resources/OSGI-INF/bundle.info
deleted file mode 100644
index f4d4790..0000000
--- a/jdbc/command/src/main/resources/OSGI-INF/bundle.info
+++ /dev/null
@@ -1,26 +0,0 @@
-h1. Synopsis
-
-${project.name}
-
-${project.description}
-
-Maven URL:
-[mvn:${project.groupId}/${project.artifactId}/${project.version}]
-
-h1. Description
-
-This bundle provides the shell commands to manipulate the JDBC service.
-
-The following commands are available:
-
-* jdbc:create
-* jdbc:delete
-* jdbc:datasources
-* jdbc:command
-* jdbc:query
-* jdbc:tables
-* jdbc:info
-
-h1. See also
-
-JDBC - section of the Karaf User Guide
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/NOTICE
----------------------------------------------------------------------
diff --git a/jdbc/core/NOTICE b/jdbc/core/NOTICE
deleted file mode 100644
index b70f1f9..0000000
--- a/jdbc/core/NOTICE
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Karaf
-Copyright 2010-2014 The Apache Software Foundation
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-OW2 (http://www.ow2.org/).
-Licensed under the BSD License.
-
-This product includes software developed at
-OPS4J (http://www.ops4j.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the EPL.
-
-This product includes software written by
-Antony Lesuisse.
-Licensed under Public Domain.
-
-
-II. Used Software
-
-This product uses software developed at
-FUSE Source (http://www.fusesource.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-AOP Alliance (http://aopalliance.sourceforge.net/).
-Licensed under the Public Domain.
-
-This product uses software developed at
-Tanuki Software (http://www.tanukisoftware.com/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-Jasypt (http://jasypt.sourceforge.net/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-JLine (http://jline.sourceforge.net).
-Licensed under the BSD License.
-
-This product uses software developed at
-SLF4J (http://www.slf4j.org/).
-Licensed under the MIT License.
-
-This product uses software developed at
-SpringSource (http://www.springsource.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
-
-III. License Summary
-- Apache License 2.0
-- BSD License
-- EPL License
-- MIT License
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/pom.xml
----------------------------------------------------------------------
diff --git a/jdbc/core/pom.xml b/jdbc/core/pom.xml
deleted file mode 100644
index 03fc7bd..0000000
--- a/jdbc/core/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.karaf.jdbc</groupId>
- <artifactId>jdbc</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>org.apache.karaf.jdbc.core</artifactId>
- <packaging>bundle</packaging>
- <name>Apache Karaf :: JDBC :: Core</name>
- <description>This bundle provides core implementation of the JDBC service.</description>
-
- <properties>
- <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.karaf</groupId>
- <artifactId>org.apache.karaf.util</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${project.basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.info</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>
- org.apache.karaf.jdbc
- </Export-Package>
- <Private-Package>
- org.apache.karaf.jdbc.internal,
- org.apache.karaf.util
- </Private-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java b/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java
deleted file mode 100644
index 26165c8..0000000
--- a/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc;
-
-import javax.management.MBeanException;
-import javax.management.openmbean.TabularData;
-import java.util.Map;
-
-/**
- * JDBC MBean
- */
-public interface JdbcMBean {
-
- /**
- * Get the list of JDBC datasources.
- *
- * @return a tabular data containing the list of JDBC datasources.
- * @throws MBeanException
- */
- TabularData getDatasources() throws MBeanException;
-
- /**
- * Create a JDBC datasource.
- *
- * @param name the JDBC datasource name.
- * @param type the JDBC datasource type (generic, MySQL, Oracle, Postgres, H2, HSQL, Derby, MSSQL).
- * @param driver the JDBC datasource driver class name (can be null).
- * @param version the target JDBC driver version (can be null).
- * @param url the JDBC URL.
- * @param user the database username.
- * @param password the database password.
- * @param installBundles true to install the bundles providing the JDBC driver, false to not install.
- * @throws MBeanException
- */
- void create(String name, String type, String driver, String version, String url, String user, String password, boolean installBundles) throws MBeanException;
-
- /**
- * Delete a JDBC datasource.
- *
- * @param name the JDBC datasource name (the one used at creation time).
- * @throws MBeanException
- */
- void delete(String name) throws MBeanException;
-
- /**
- * Get details about a JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @return a map (property/value) containing JDBC datasource details.
- * @throws MBeanException
- */
- Map<String, String> info(String datasource) throws MBeanException;
-
- /**
- * Get the tables available on a JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @return a tabular data containg datasource tables.
- * @throws MBeanException
- */
- TabularData tables(String datasource) throws MBeanException;
-
- /**
- * Execute a SQL command on a JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @param command the SQL command to execute.
- * @throws MBeanException
- */
- void execute(String datasource, String command) throws MBeanException;
-
- /**
- * Execute a SQL query on a JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @param query the SQL query to execute.
- * @return a tabular data with the result of execute (columns/values).
- * @throws MBeanException
- */
- TabularData query(String datasource, String query) throws MBeanException;
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcService.java
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcService.java b/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcService.java
deleted file mode 100644
index d883a07..0000000
--- a/jdbc/core/src/main/java/org/apache/karaf/jdbc/JdbcService.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * JDBC Service.
- */
-public interface JdbcService {
-
- /**
- * Create a JDBC datasource (using a default template).
- *
- * @param name the JDBC datasource name.
- * @param type the backend database type (generic, Oracle, MySQL, ...)
- * @param driverClassName the JDBC driver classname.
- * @param version the JDBC driver version to use.
- * @param url the JDBC URL.
- * @param user the database user name.
- * @param password the database password.
- * @param tryToInstallBundles true to try to automatically install the required bundles (JDBC driver, etc) when possible, false else.
- */
- void create(String name, String type, String driverClassName, String version, String url, String user, String password, boolean tryToInstallBundles) throws Exception;
-
- /**
- * Delete a JDBC datasource identified by a name.
- *
- * @param name the JDBC datasource name.
- */
- void delete(String name) throws Exception;
-
- /**
- * List the JDBC datasources available.
- *
- * @return a list of datasources name.
- */
- List<String> datasources() throws Exception;
-
- /**
- * List the JDBC datasources configuration file names present in the deploy folder.
- *
- * @return a list of the JDBC datasources configuration file names.
- */
- List<String> datasourceFileNames() throws Exception;
-
- /**
- * Execute a SQL query on a given JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @param query the SQL query to execute.
- * @return the SQL query result (as a String).
- */
- Map<String, List<String>> query(String datasource, String query) throws Exception;
-
- /**
- * Execute a SQL command on a given JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @param command the SQL command to execute.
- */
- void execute(String datasource, String command) throws Exception;
-
- /**
- * List the tables available on a given JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @return the list of table names.
- */
- Map<String, List<String>> tables(String datasource) throws Exception;
-
- /**
- * Get detailed info about a JDBC datasource.
- *
- * @param datasource the JDBC datasource name.
- * @return a map of info (name/value).
- */
- Map<String, String> info(String datasource) throws Exception;
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcConnector.java
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcConnector.java b/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcConnector.java
deleted file mode 100644
index 11c7ca4..0000000
--- a/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcConnector.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.internal;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.sql.*;
-import java.util.Deque;
-import java.util.LinkedList;
-
-import javax.sql.DataSource;
-import javax.sql.XAConnection;
-import javax.sql.XADataSource;
-
-import org.apache.karaf.util.StreamUtils;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class JdbcConnector implements Closeable {
- private BundleContext bundleContext;
- private String datasourceName;
- private Connection connection;
- private Deque<Closeable> resources;
- private ServiceReference<?> reference;
-
- public JdbcConnector(BundleContext bundleContext, String datasourceName) {
- this.bundleContext = bundleContext;
- this.datasourceName = datasourceName;
- this.resources = new LinkedList<Closeable>();
- }
-
- public Connection connect() throws SQLException {
- reference = lookupDataSource(datasourceName);
- Object datasource = bundleContext.getService(reference);
- if (datasource instanceof DataSource) {
- connection = ((DataSource) datasource).getConnection();
- }
- if (datasource instanceof XADataSource) {
- connection = ((XADataSource) datasource).getXAConnection().getConnection();
- }
- return connection;
- }
-
- public Statement createStatement() throws SQLException {
- if (connection == null) {
- connect();
- }
- if (connection instanceof Connection) {
- return register(((Connection) connection).createStatement());
- }
- if (connection instanceof XAConnection) {
- return register(((XAConnection) connection).getConnection().createStatement());
- }
- return null;
- }
-
- public Connection register(final Connection connection) {
- resources.addFirst(new Closeable() {
-
- @Override
- public void close() throws IOException {
- try {
- connection.close();
- } catch (SQLException e) {
- // Ignore
- }
- }
- });
- return connection;
- }
-
- public Statement register(final Statement statement) {
- resources.addFirst(new Closeable() {
-
- @Override
- public void close() throws IOException {
- try {
- statement.close();
- } catch (SQLException e) {
- // Ignore
- }
- }
- });
- return statement;
- }
-
- public ResultSet register(final ResultSet resultSet) {
- resources.addFirst(new Closeable() {
-
- @Override
- public void close() throws IOException {
- try {
- resultSet.close();
- } catch (SQLException e) {
- // Ignore
- }
- }
- });
- return resultSet;
- }
-
-
- private ServiceReference<?> lookupDataSource(String name) {
- ServiceReference<?>[] references;
- try {
- references = bundleContext.getServiceReferences((String) null,
- "(&(|(" + Constants.OBJECTCLASS + "=" + DataSource.class.getName() + ")"
- + "(" + Constants.OBJECTCLASS + "=" + XADataSource.class.getName() + "))"
- + "(|(osgi.jndi.service.name=" + name + ")(datasource=" + name + ")(name=" + name + ")(service.id=" + name + ")))");
- } catch (InvalidSyntaxException e) {
- throw new IllegalArgumentException("Error finding datasource with name " + name, e);
- }
- if (references == null || references.length == 0) {
- throw new IllegalArgumentException("No JDBC datasource found for " + name);
- }
- if (references.length > 1) {
- throw new IllegalArgumentException("Multiple JDBC datasource found for " + name);
- }
- return references[0];
- }
-
- @Override
- public void close() {
- StreamUtils.close(resources.toArray(new Closeable[]{}));
- if (reference != null) {
- bundleContext.ungetService(reference);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcMBeanImpl.java
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcMBeanImpl.java b/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcMBeanImpl.java
deleted file mode 100644
index 92bbba8..0000000
--- a/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcMBeanImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.internal;
-
-import org.apache.karaf.jdbc.JdbcMBean;
-import org.apache.karaf.jdbc.JdbcService;
-
-import javax.management.MBeanException;
-import javax.management.openmbean.*;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Default implementation of the JDBC MBean.
- */
-public class JdbcMBeanImpl implements JdbcMBean {
-
- private JdbcService jdbcService;
-
- @Override
- public TabularData getDatasources() throws MBeanException {
- try {
- CompositeType type = new CompositeType("DataSource", "JDBC DataSource",
- new String[]{ "name", "product", "version", "url "},
- new String[]{ "Name", "Database product", "Database version", "JDBC URL" },
- new OpenType[]{ SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING });
- TabularType tableType = new TabularType("JDBC DataSources", "Table of the JDBC DataSources",
- type, new String[]{ "name" });
- TabularData table = new TabularDataSupport(tableType);
-
- for (String datasource : jdbcService.datasources()) {
- Map<String, String> info = jdbcService.info(datasource);
- CompositeData data = new CompositeDataSupport(type,
- new String[]{ "name", "product", "version", "url" },
- new Object[]{ datasource, info.get("db.product"), info.get("db.version"), info.get("url") });
- table.put(data);
- }
-
- return table;
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- @Override
- public void create(String name, String type, String driver, String version, String url, String user, String password, boolean installBundles) throws MBeanException {
- try {
- jdbcService.create(name, type, driver, version, url, user, password, installBundles);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- @Override
- public void delete(String name) throws MBeanException {
- try {
- jdbcService.delete(name);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- @Override
- public Map<String, String> info(String datasource) throws MBeanException {
- try {
- return jdbcService.info(datasource);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- @Override
- public TabularData tables(String datasource) throws MBeanException {
- try {
- Map<String, List<String>> result = jdbcService.tables(datasource);
- OpenType[] stringTypes = new OpenType[result.keySet().size()];
- for (int i = 0; i < stringTypes.length; i++) {
- stringTypes[i] = SimpleType.STRING;
- }
- String[] columns = result.keySet().toArray(new String[result.keySet().size()]);
-
- CompositeType type = new CompositeType("Columns", "Columns",
- columns, columns, stringTypes);
- TabularType rows = new TabularType("Result", "Result Rows", type, columns);
- TabularData table = new TabularDataSupport(rows);
-
- int rowCount = result.get(result.keySet().iterator().next()).size();
-
- for (int i = 0; i < rowCount; i++) {
- Object[] row = new Object[columns.length];
- for (int j = 0; j < columns.length; j++) {
- row[j] = result.get(columns[j]).get(i);
- }
- CompositeData data = new CompositeDataSupport(type, columns, row);
- table.put(data);
- }
-
- return table;
- } catch (Exception e) {
- e.printStackTrace();
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- @Override
- public void execute(String datasource, String command) throws MBeanException {
- try {
- jdbcService.execute(datasource, command);
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- @Override
- public TabularData query(String datasource, String query) throws MBeanException {
- try {
- Map<String, List<String>> result = jdbcService.query(datasource, query);
- OpenType[] stringTypes = new OpenType[result.keySet().size()];
- for (int i = 0; i < stringTypes.length; i++) {
- stringTypes[i] = SimpleType.STRING;
- }
- String[] columns = result.keySet().toArray(new String[result.keySet().size()]);
-
- CompositeType type = new CompositeType("Columns", "Columns",
- columns, columns, stringTypes);
- TabularType rows = new TabularType("Result", "Result Rows", type, columns);
- TabularData table = new TabularDataSupport(rows);
-
- int rowCount = result.get(result.keySet().iterator().next()).size();
-
- for (int i = 0; i < rowCount; i++) {
- Object[] row = new Object[columns.length];
- for (int j = 0; j < columns.length; j++) {
- row[j] = result.get(columns[j]).get(i);
- }
- CompositeData data = new CompositeDataSupport(type, columns, row);
- table.put(data);
- }
-
- return table;
- } catch (Exception e) {
- throw new MBeanException(null, e.getMessage());
- }
- }
-
- public JdbcService getJdbcService() {
- return jdbcService;
- }
-
- public void setJdbcService(JdbcService jdbcService) {
- this.jdbcService = jdbcService;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcServiceImpl.java
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcServiceImpl.java b/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcServiceImpl.java
deleted file mode 100644
index 50cf8ff..0000000
--- a/jdbc/core/src/main/java/org/apache/karaf/jdbc/internal/JdbcServiceImpl.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jdbc.internal;
-
-import org.apache.karaf.jdbc.JdbcService;
-import org.apache.karaf.util.TemplateUtils;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-
-import javax.sql.DataSource;
-import javax.sql.XADataSource;
-
-import java.io.*;
-import java.sql.*;
-import java.util.*;
-
-/**
- * Default implementation of the JDBC Service.
- */
-public class JdbcServiceImpl implements JdbcService {
-
- public static enum TYPES {
- DB2("wrap:mvn:com.ibm.db2.jdbc/db2jcc/", "9.7", "datasource-db2.xml"),
- DERBY("mvn:org.apache.derby/derby/", "10.8.2.2", "datasource-derby.xml"),
- GENERIC(null, null, "datasource-generic.xml"),
- H2("mvn:com.h2database/h2/", "1.3.163", "datasource-h2.xml"),
- HSQL("mvn:org.hsqldb/hsqldb/", "2.3.2", "datasource-hsql.xml"),
- MYSQL("mvn:mysql/mysql-connector-java/", "5.1.18", "datasource-mysql.xml"),
- MSSQL("wrap:mvn:net.sourceforge.jtds/jtds/", "1.2.4", "datasource-mssql.xml"),
- ORACLE("wrap:mvn:ojdbc/ojdbc/", "11.2.0.2.0", "datasource-oracle.xml"),
- POSTGRES("wrap:mvn:postgresql/postgresql/", "9.1-901.jdbc4", "datasource-postgres.xml");
-
- private final String bundleUrl;
- private final String defaultVersion;
- private final String templateFile;
-
- TYPES(String bundleUrl, String defaultVersion, String templateFile) {
- this.bundleUrl = bundleUrl;
- this.defaultVersion = defaultVersion;
- this.templateFile = templateFile;
- }
-
- public void installBundle(BundleContext bundleContext, String version) throws Exception {
- String location = this.bundleUrl + getWithDefault(version, this.defaultVersion);
- bundleContext.installBundle(location, null).start();
- }
-
- private String getWithDefault(String st, String defaultSt) {
- return (st == null)? defaultSt : st;
- }
-
- public void copyDataSourceFile(File outFile, HashMap<String, String> properties) {
- InputStream is = this.getClass().getResourceAsStream(templateFile);
- if (is == null) {
- throw new IllegalArgumentException("Template resource " + templateFile + " doesn't exist");
- }
- TemplateUtils.createFromTemplate(outFile, is, properties);
- }
-
- }
-
- private BundleContext bundleContext;
-
- @Override
- public void create(String name, String type, String driverClassName, String version, String url, String user, String password, boolean tryToInstallBundles) throws Exception {
- if (type == null) {
- throw new IllegalStateException("No database type supplied");
- }
- TYPES dbType = TYPES.valueOf(type.toUpperCase());
-
- if (tryToInstallBundles) {
- dbType.installBundle(bundleContext, version);
- }
-
- File karafBase = new File(System.getProperty("karaf.base"));
- File deployFolder = new File(karafBase, "deploy");
- File outFile = new File(deployFolder, "datasource-" + name + ".xml");
-
- HashMap<String, String> properties = new HashMap<String, String>();
- properties.put("name", name);
- properties.put("driver", driverClassName);
- properties.put("url", url);
- properties.put("user", user);
- properties.put("password", password);
-
- dbType.copyDataSourceFile(outFile, properties);
- }
-
- @Override
- public void delete(String name) throws Exception {
- File karafBase = new File(System.getProperty("karaf.base"));
- File deployFolder = new File(karafBase, "deploy");
- File datasourceFile = new File(deployFolder, "datasource-" + name + ".xml");
- if (!datasourceFile.exists()) {
- throw new IllegalArgumentException("The JDBC datasource file "+ datasourceFile.getPath() + " doesn't exist");
- }
- datasourceFile.delete();
- }
-
- @Override
- public List<String> datasources() throws Exception {
- List<String> datasources = new ArrayList<String>();
-
- ServiceReference<?>[] references = bundleContext.getServiceReferences((String) null, "(|(" + Constants.OBJECTCLASS + "=" + DataSource.class.getName() + ")("
- + Constants.OBJECTCLASS + "=" + XADataSource.class.getName() + "))");
- if (references != null) {
- for (ServiceReference reference : references) {
- if (reference.getProperty("osgi.jndi.service.name") != null) {
- datasources.add((String) reference.getProperty("osgi.jndi.service.name"));
- } else if (reference.getProperty("datasource") != null) {
- datasources.add((String) reference.getProperty("datasource"));
- } else if (reference.getProperty("name") != null) {
- datasources.add((String) reference.getProperty("name"));
- } else {
- datasources.add(reference.getProperty(Constants.SERVICE_ID).toString());
- }
- }
- }
- return datasources;
- }
-
- @Override
- public List<String> datasourceFileNames() throws Exception {
- File karafBase = new File(System.getProperty("karaf.base"));
- File deployFolder = new File(karafBase, "deploy");
-
- String[] datasourceFileNames = deployFolder.list(new FilenameFilter() {
-
- @Override
- public boolean accept(File dir, String name) {
- return name.startsWith("datasource-") && name.endsWith(".xml");
- }
- });
-
- return Arrays.asList(datasourceFileNames);
- }
-
- @Override
- public Map<String, List<String>> query(String datasource, String query) throws Exception {
- JdbcConnector jdbcConnector = new JdbcConnector(bundleContext, datasource);
- try {
- Map<String, List<String>> map = new HashMap<String, List<String>>();
- Statement statement = jdbcConnector.createStatement();
- ResultSet resultSet = jdbcConnector.register(statement.executeQuery(query));
- ResultSetMetaData metaData = resultSet.getMetaData();
- for (int c = 1; c <= metaData.getColumnCount(); c++) {
- map.put(metaData.getColumnLabel(c), new ArrayList<String>());
- }
- while (resultSet.next()) {
- for (int c = 1; c <= metaData.getColumnCount(); c++) {
- map.get(metaData.getColumnLabel(c)).add(resultSet.getString(c));
- }
- }
- return map;
- } finally {
- jdbcConnector.close();
- }
- }
-
- @Override
- public void execute(String datasource, String command) throws Exception {
- JdbcConnector jdbcConnector = new JdbcConnector(bundleContext, datasource);
- try {
- jdbcConnector.createStatement().execute(command);
- } finally {
- jdbcConnector.close();
- }
- }
-
- @Override
- public Map<String, List<String>> tables(String datasource) throws Exception {
- JdbcConnector jdbcConnector = new JdbcConnector(bundleContext, datasource);
- try {
-
- DatabaseMetaData dbMetaData = jdbcConnector.connect().getMetaData();
- ResultSet resultSet = jdbcConnector.register(dbMetaData.getTables(null, null, null, null));
- ResultSetMetaData metaData = resultSet.getMetaData();
- Map<String, List<String>> map = new HashMap<String, List<String>>();
- for (int c = 1; c <= metaData.getColumnCount(); c++) {
- map.put(metaData.getColumnLabel(c), new ArrayList<String>());
- }
- while (resultSet.next()) {
- for (int c = 1; c <= metaData.getColumnCount(); c++) {
- map.get(metaData.getColumnLabel(c)).add(resultSet.getString(c));
- }
- }
- return map;
- } finally {
- jdbcConnector.close();
- }
- }
-
- @Override
- public Map<String, String> info(String datasource) throws Exception {
- JdbcConnector jdbcConnector = new JdbcConnector(bundleContext, datasource);
- try {
- DatabaseMetaData dbMetaData = jdbcConnector.connect().getMetaData();
- Map<String, String> map = new HashMap<String, String>();
- map.put("db.product", dbMetaData.getDatabaseProductName());
- map.put("db.version", dbMetaData.getDatabaseProductVersion());
- map.put("url", dbMetaData.getURL());
- map.put("username", dbMetaData.getUserName());
- map.put("driver.name", dbMetaData.getDriverName());
- map.put("driver.version", dbMetaData.getDriverVersion());
- return map;
- } finally {
- jdbcConnector.close();
- }
- }
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/resources/OSGI-INF/blueprint/jdbc-core.xml
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/resources/OSGI-INF/blueprint/jdbc-core.xml b/jdbc/core/src/main/resources/OSGI-INF/blueprint/jdbc-core.xml
deleted file mode 100644
index e961697..0000000
--- a/jdbc/core/src/main/resources/OSGI-INF/blueprint/jdbc-core.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for
- the specific language governing permissions and limitations under the
- License.
- -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
- default-activation="lazy">
-
- <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
-
- <bean id="jdbcService" class="org.apache.karaf.jdbc.internal.JdbcServiceImpl">
- <property name="bundleContext" ref="blueprintBundleContext"/>
- </bean>
-
- <service ref="jdbcService" interface="org.apache.karaf.jdbc.JdbcService" />
-
- <!-- Management -->
- <bean id="jdbcMBeanImpl" class="org.apache.karaf.jdbc.internal.JdbcMBeanImpl">
- <property name="jdbcService" ref="jdbcService"/>
- </bean>
-
- <service ref="jdbcMBeanImpl" auto-export="interfaces">
- <service-properties>
- <entry key="jmx.objectname" value="org.apache.karaf:type=jdbc,name=$[karaf.name]"/>
- </service-properties>
- </service>
-
-</blueprint>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/resources/OSGI-INF/bundle.info
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/resources/OSGI-INF/bundle.info b/jdbc/core/src/main/resources/OSGI-INF/bundle.info
deleted file mode 100644
index bc7a1cd..0000000
--- a/jdbc/core/src/main/resources/OSGI-INF/bundle.info
+++ /dev/null
@@ -1,18 +0,0 @@
-h1. Synopsis
-
-${project.name}
-
-${project.description}
-
-Maven URL:
-[mvn:${project.groupId}/${project.artifactId}/${project.version}]
-
-h1. Description
-
-This bundle is the core implementation of the JDBC service support.
-
-The JDBC service allows you to create datasources, see the defined datasources, execute query on a datasource, etc.
-
-h1. See also
-
-JDBC - section of the Karaf User Guide
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-db2.xml
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-db2.xml b/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-db2.xml
deleted file mode 100644
index da220a5..0000000
--- a/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-db2.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for
- the specific language governing permissions and limitations under the
- License.
- -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
- <bean id="dataSource" class="com.ibm.db2.jcc.DB2DataSource">
- <property name="url" value="${url}"/>
- <property name="user" value="${user}"/>
- <property name="password" value="${password}"/>
- </bean>
-
- <service interface="javax.sql.DataSource" ref="dataSource">
- <service-properties>
- <entry key="osgi.jndi.service.name" value="jdbc/${name}"/>
- </service-properties>
- </service>
-
-</blueprint>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-derby.xml
----------------------------------------------------------------------
diff --git a/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-derby.xml b/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-derby.xml
deleted file mode 100644
index 440a439..0000000
--- a/jdbc/core/src/main/resources/org/apache/karaf/jdbc/internal/datasource-derby.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version
- 2.0 (the "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0 Unless required by
- applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for
- the specific language governing permissions and limitations under the
- License.
- -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- default-activation="eager">
-
- <bean id="dataSource" class="org.apache.derby.jdbc.EmbeddedXADataSource">
- <property name="databaseName" value="${name}"/>
- <property name="createDatabase" value="create" />
- </bean>
-
- <service ref="dataSource" interface="javax.sql.DataSource">
- <service-properties>
- <entry key="osgi.jndi.service.name" value="jdbc/${name}"/>
- </service-properties>
- </service>
-
- <service ref="dataSource" interface="javax.sql.XADataSource">
- <service-properties>
- <entry key="osgi.jndi.service.name" value="jdbc/${name}xa"/>
- </service-properties>
- </service>
-
-</blueprint>