Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB4579C08 for ; Tue, 20 Mar 2012 12:20:32 +0000 (UTC) Received: (qmail 58593 invoked by uid 500); 20 Mar 2012 12:20:32 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 58475 invoked by uid 500); 20 Mar 2012 12:20:32 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Delivered-To: moderator for users@felix.apache.org Received: (qmail 31215 invoked by uid 99); 20 Mar 2012 12:13:59 -0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cschneider111@googlemail.com designates 209.85.214.49 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7ST3UiUU7NDTjBkGAlZaAtp7mBtw7evC3yvro//nL6k=; b=0tRBLP4+9jTv7zg68QNWxzwdOEfODBYM3yUgAVkxDwXR2454sRTtiQz0CQlyTdzWrS IQ883O5UT7M2PA2emjbmPCxka/jf/9V/iXBxBZlSrlvrj/7C5dqAR52NAEmblktLBlcJ z7kpRkdHcfQ2RG02r9mGTiVzZgoSUUAfKhaX9CylrEJdb5uRDkqNoTUj4JcqBc7T8BQI cnqtedmTYbq2WJCsreTMEbKYzXmy85ROHJYGjLGc/lfsY59aEAq87jAqMs+Ylpil/RCt 4cGOBA041evE910uSRilrhnje4xedqV1OsrIgL5Nc8dwKysY/zc4HYWuDmfB9Sh/kc4B Az+w== Sender: Christian Schneider Message-ID: <4F687468.3070700@die-schneider.net> Date: Tue, 20 Mar 2012 13:13:28 +0100 From: Christian Schneider User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: users@felix.apache.org Subject: Re: Connect a bundle to a data base References: <4F6319A6.2060109@die-schneider.net> <4F64D646.2050708@die-schneider.net> <4F2F925C53AC43E5BF3B1F2F3C425082@gmail.com> In-Reply-To: <4F2F925C53AC43E5BF3B1F2F3C425082@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Absolutely. That is what I wanted to say in my last post. The only problem with this aproach is that you hardcode the database type in your bridge bundle. ( At least if you dont want to mess with the classloader). As you probably will not have that many database types in one use case this is probably ok though. Christian Am 20.03.2012 11:27, schrieb Neil Bartlett: > You certainly don't need Glassfish... you don't need Karaf or Blueprint either. > > There is a tendency on many mailing lists to respond to beginner questions with answers like "you can do this with product X" where X happens to be the product that the person is working on or selling. Those products may indeed add value but they are rarely the only or the simplest way to achieve what you want! > > To register a DataSource service with pure OSGi, it's as simple as writing this code in a BundleActivator (using MySQL as an example): > > DataSource ds = new com.mysql.jdbc.jdbc2.optional.MysqlDataSource(); > context.registerService(DataSource.class.getName(), ds, null); > > This would be your "bridge" bundle that you deploy alongside the MySQL driver JAR. For other database types, write a different 2 lines of code and deploy that bundle instead. > > Kind regards, > Neil > > -- Christian Schneider http://www.liquid-reality.de Open Source Architect Talend Application Integration Division http://www.talend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org