Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 67859 invoked from network); 8 Mar 2003 13:45:58 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 8 Mar 2003 13:45:58 -0000 Received: (qmail 19794 invoked by uid 97); 8 Mar 2003 13:47:38 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 19787 invoked from network); 8 Mar 2003 13:47:38 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 8 Mar 2003 13:47:38 -0000 Received: (qmail 67591 invoked by uid 500); 8 Mar 2003 13:45:56 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 67569 invoked from network); 8 Mar 2003 13:45:46 -0000 Received: from jim.skynet.lt (212.122.68.65) by daedalus.apache.org with SMTP; 8 Mar 2003 13:45:46 -0000 Received: (qmail 76601 invoked by uid 85); 8 Mar 2003 13:45:24 -0000 Received: from baliuka@centras.lt by jim.skynet.vl with qmail-scanner-1.03 (. Clean. Processed in 9.299359 secs); 08 Mar 2003 13:45:24 -0000 X-Qmail-Scanner-Mail-From: baliuka@centras.lt via jim.skynet.vl X-Qmail-Scanner: 1.03 (Clean. Processed in 9.299359 secs) Received: from unknown (HELO user) (10.1.17.1) by mail.skynet.lt with SMTP; 8 Mar 2003 13:45:14 -0000 Message-ID: <00f101c2e578$f4460160$0111010a@user> From: "Juozas Baliuka" To: "Jakarta Commons Developers List" References: Subject: [dbutils]Dependancy on QDox was Re: [dbutils] Proxies Date: Sat, 8 Mar 2003 15:45:12 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I have started implementation for this stuff, it depends on QDox ( javadoc parser ), I need some metada to implement sql procedure call, java sourse file is used as metadata itself: interface MyDAO{ /** * @sql SELECT * FROM MY_TABLE * @handler com.maycompany.MyHandler */ Collection getAll(); /** * @sql SELECT MAX(VALUE) FROM MY_TABLE WHERE VALUE < $1 * */ int getMaxLesThan(int p1); /** * @sql SELECT COUNT(*) FROM MY_TABLE WHERE VALUE < $1 and VALUE >= $2 */ int getCount(int p1, int p2); /** * @sql UPDATE MY_TABLE SET VALUE=$1 * @handler update */ void setValue(int value); } } public class Main{ public static main( String args[] ){ Connection connection = getConnection(); try{ MyDAO dao = ( MyDAO)ProcedureUtils.getInstance(MyDAO.class, connection ); dao.setValue( dao.getCount(200, getMaxLesThan(1)) ); connection.commit(); }finaly{ connection.close(); } } QDox is used to parse metada at runtime, implementation is generated at runtime too (java.lang.reflect.Proxy), XML free code, no custom build tools and reinvented QL. Is it not out of dbutils scope ? ----- Original Message ----- From: "Henri Yandell" To: "Jakarta Commons Developers List" Sent: Thursday, March 06, 2003 3:35 AM Subject: Re: [dbutils] Proxies > > Seems okay to me. Though I think religious things should probably be in > their own Class namespace rather than the central DbUtils namespace. > > So: ProcedureUtils, or even procedure.ProcedureUtils. > > DbUtils can use these invisibly [as it currently uses ResultSetHandler via > anonymous classes and private methods] but would never offer up any type > from a sub-package/religion. > > Looking a bit further, the only bit I dislike is the > DbUtils.setConnection(conn). In my view this should be an explicit > instance, so [ignoring the namespace issues] you'd do: > > DbUtils dbutils = DbUtils.getInstance(); > dbutils.setConnection(conn); > dbutils.doThing(); // etc > > Though I'm not sure you didn't mean to do that anyway :) > > Hen > > On Wed, 5 Mar 2003, Juozas Baliuka wrote: > > > I remember we decided not to implement religion in dbutils, but we can try > > this kind of experiment : > > > > interface MyProcedure { > > > > int executeSomeQuery( int p1, String p2 ); > > > > } > > > > static final MyProcedure PROC1 = DbUtils.newInstance( MyProcedure.class, > > > > sql, > > > > new ResultSetHandlerImpl() > > > > ); > > > > //use it this way (connection is in ThreadLocal ) > > DbUtils.setConnection(connection); > > in a = PROC1.executeSomeQuery(1,"test"); > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org