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 874A59C6F for ; Fri, 16 Mar 2012 12:57:10 +0000 (UTC) Received: (qmail 5799 invoked by uid 500); 16 Mar 2012 12:57:10 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 5714 invoked by uid 500); 16 Mar 2012 12:57:10 -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 30453 invoked by uid 99); 16 Mar 2012 10:45:20 -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 (athena.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=FaHjFdddeitxfgxHPF+UbF9PaRr16Pd021s4vIEKYVg=; b=lzzUNy0GyPSECotFRvhMfgWIfZN93NWKP7kdjoo2pckVUsCjQq7M8xX8KOra0EZGSV GeSEIZsWrmnqniycl6HBS04oyEKdpXFGnGeh9HDmmwOXIPcIQV/n88zozXo+CmtMIP41 hHwf7xS6e3bF8BhRDHVAb/bS8yAqt+6wEdEWjtTwV4tDpGX2G6Caw+8AgSvtGp0ULo8h /IAQ3+oVsAveDa0wv6ULwn3RKskfH5etfxVUPAxFYhqqSGzZJCaj6AugU8oae/Fsywhl MiTqBl9JKZcB3yipBi1B6TUN9gO1dHfXFi8zXVaj52Uoecjfe3Ewa2Eh3+jMf9u2OFf3 qOQQ== Sender: Christian Schneider Message-ID: <4F6319A6.2060109@die-schneider.net> Date: Fri, 16 Mar 2012 11:44:54 +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: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org The best practice is to configure a DataSource outside of the bundle and offer it as a OSGi service. So the user bundle should just reference the datasource and use it. The legacy aproach with using a database driver classname to configure jdbc does not work well in OSGi. I have a tutorial that shows how to do this with Apache Karaf. This should also be possible with pure felix just perhaps a little more effort. http://www.liquid-reality.de/x/LYBk Christian Am 16.03.2012 10:10, schrieb elMateo: > Hello all, > > I need to connect a bundle to a MySQL data base and I don't know how I can > do it. > > I know that I can't do the same that in a normal Java application, but I > don't find the correct form to do this. > > Could anybody help me? > > Thanks in advance, Jesus > -- 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