Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E446870AC for ; Fri, 14 Oct 2011 13:11:59 +0000 (UTC) Received: (qmail 85546 invoked by uid 500); 14 Oct 2011 13:11:59 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 85520 invoked by uid 500); 14 Oct 2011 13:11:59 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 85512 invoked by uid 99); 14 Oct 2011 13:11:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2011 13:11:59 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.82.47] (HELO mail-ww0-f47.google.com) (74.125.82.47) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2011 13:11:51 +0000 Received: by wwg7 with SMTP id 7so345627wwg.28 for ; Fri, 14 Oct 2011 06:11:30 -0700 (PDT) Received: by 10.216.82.141 with SMTP id o13mr1563616wee.10.1318597890119; Fri, 14 Oct 2011 06:11:30 -0700 (PDT) Received: from [200.190.12.151] ([212.51.168.10]) by mx.google.com with ESMTPS id p2sm14110840wbo.17.2011.10.14.06.11.27 (version=SSLv3 cipher=OTHER); Fri, 14 Oct 2011 06:11:28 -0700 (PDT) Message-ID: <4E9834FE.8010506@smaeur.eu> Date: Fri, 14 Oct 2011 15:11:26 +0200 From: Francois Eyl Reply-To: feyl@smaeur.eu User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 MIME-Version: 1.0 To: user@cayenne.apache.org Subject: Re: Best practice to support multiple database vendors (DB2 or MSSQL Server) References: <4E982AB5.9070802@smaeur.eu> <4E982D92.70702@maniatis.org> In-Reply-To: <4E982D92.70702@maniatis.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Ok, that's what I was wondering, but wasn't sure because of all DBEntity attributes that seem to be specific to database's vendor (CHAR vs NCHAR or DECIMAL vs NUMERIC). I'll try to connect to the MSSQL database using the appropriate JDBC driver and see. Thanks, Francois On 14/10/2011 14:39, Aristedes Maniatis wrote: > On Fri Oct 14 23:27:33 2011, Francois Eyl wrote: >> Hi guys, >> >> I'm using Cayenne on my project in order to interface it with a third >> party application through its database. Until now, the database was a >> DB2 (AS400), but the application now supports MS SQL Server as well. >> So, I need to support both DB2 and MSSQL Server of course. The >> databases schemas are stricly the same. >> >> I wonder what is the best way to achieve this, knowing that I already >> have my datamap & datanode ready for DB2. I'd like to avoid >> redefining ObjectEntities by implementation (one set of data for DB2 >> and another for SQLServer). How do you recommand me to proceed? >> >> Do I need to create an other DataDomain, and "duplicate" the >> definition stuff? >> >> Thanks in advance, >> Francois >> > > In most cases, there is absolutely nothing to do at all. Just connect > to the database of your choice and Cayenne will make it all work. >