sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-org-apache-sling-datasource] 08/22: SLING-3574 - JDBC DataSource Provider bundle
Date Tue, 07 Nov 2017 09:25:18 GMT
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.datasource-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-datasource.git

commit f88c56384735153affed32833c05aac12ab61a41
Author: Chetan Mehrotra <chetanm@apache.org>
AuthorDate: Mon Jun 16 06:14:03 2014 +0000

    SLING-3574 - JDBC DataSource Provider bundle
    
    Adding docs around wrapping driver jars
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/datasource@1602803
13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 42f9f2d..fa7ed6e 100644
--- a/README.md
+++ b/README.md
@@ -60,5 +60,31 @@ Following snippet demonstrates accessing the DataSource named `foo` via
DS annot
         private DataSource dataSource;
     }
 
+Convert Driver jars to Bundle
+-----------------------------
+
+Most of the JDBC driver jars have the required OSGi headers and can be directly deployed
to OSGi container
+as bundles. However some of the drivers e.g. Postgres are not having such headers and hence
need to be 
+converted to OSGi bundles. For them we can use the [Bnd Wrap][2] command.
+
+For example to convert the Postgres driver jar follow the steps below
+
+    $ wget https://github.com/bndtools/bnd/releases/download/2.3.0.REL/biz.aQute.bnd-2.3.0.jar
-O bnd.jar
+    $ wget http://jdbc.postgresql.org/download/postgresql-9.3-1101.jdbc41.jar
+    $ cat > bnd.bnd <<EOT
+    Bundle-Version: 9.3.1101
+    Bundle-SymbolicName: org.postgresql
+    Export-Package: org.postgresql
+    Include-Resource: @postgresql-9.3-1101.jdbc41.jar
+    EOT
+    $ java -jar bnd.jar bnd.bnd
+    
+In the steps above we
+
+1. Download the bnd jar and postgres driver jar
+2. Create a bnd file with required instructions. 
+3. Execute the bnd command
+4. Resulting bundle is present in `org.postgresql-9.3.1101.jar`
  
-[1]: http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
\ No newline at end of file
+[1]: http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
+[2]: http://www.aqute.biz/Bnd/Wrapping
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Mime
View raw message