Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5KTr-0002h3-66 for pgsql-jdbc@arkaria.postgresql.org; Wed, 17 Jun 2015 21:02:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z5KTq-0003Yj-H5 for pgsql-jdbc@arkaria.postgresql.org; Wed, 17 Jun 2015 21:02:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z5KTp-0003Yd-Rh for pgsql-jdbc@postgresql.org; Wed, 17 Jun 2015 21:02:42 +0000 Received: from smtprelay01.ispgateway.de ([80.67.31.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z5KTn-0000kR-2i for pgsql-jdbc@postgresql.org; Wed, 17 Jun 2015 21:02:40 +0000 Received: from [88.66.14.101] (helo=Zauselmaus) by smtprelay01.ispgateway.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from ) id 1Z5KTk-0001n6-Ix for pgsql-jdbc@postgresql.org; Wed, 17 Jun 2015 23:02:36 +0200 From: "Markus KARG" To: "'List'" References: <000c01d0a7b6$97571ee0$c6055ca0$@eu> <005101d0a86a$f18ffe90$d4affbb0$@eu> <60b20bb834cf54db8232239b9c27fcc2@imap.procolix.com> <2e15428aa0cf241e6cd9b951ba96140b@imap.procolix.com> <5d539d76f4ccb9a59abc57d5d99c4d92@imap.procolix.com> In-Reply-To: Subject: Re: Pre-processing during build Date: Wed, 17 Jun 2015 23:02:44 +0200 Organization: Markus KARG, Staatl. gepr. Inf. Message-ID: <006901d0a940$f525a330$df70e990$@eu> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdCo9bwZw7wPx4NYSt+OODXsosNHAwAStIzw Content-Language: de X-AVK-Virus-Check: AVA 25.1869;71FD75 X-AVK-Spam-Check: 1; str=0001.0A0C0203.5581E06C.015F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0; F1206 X-Df-Sender: bWFya3VzQGhlYWRjcmFzaGluZy5ldQ== X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org I think you not even need reflection, but could simply rely on proxies. Sho= uld be faster and do the job faster. http://docs.oracle.com/javase/1.5.0/do= cs/api/java/lang/reflect/Proxy.html :-) An official Java SE standard since v1.3, BTW, to prevent further discussion= s about versions. ;-) -Markus -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.o= rg] On Behalf Of Vladimir Sitnikov Sent: Mittwoch, 17. Juni 2015 14:04 To: Mark Rotteveel Cc: List Subject: Re: [JDBC] Pre-processing during build >So getting this to work would need some form of reflection (to get the right type at runtime based on the Java version) Reflection is sufficient, isn't it? I think reflection would be rather clean solution here. It is more IDE-friendly and developer-friendly than pre-processing. Reflection is much easier to debug than byte-code generation. So, do you see drawbacks with using reflection to select the specific implementation? =46rom implementation point of view it just replaces "preprocessing" with some "Class.forName" and that is it. It even allows to ship the same jar file and select implementation on the f= ly. Vladimir --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc