Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 93329 invoked from network); 15 Nov 2002 12:50:29 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 15 Nov 2002 12:50:29 -0000 Received: (qmail 9536 invoked by uid 97); 15 Nov 2002 12:51:25 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 9508 invoked by uid 97); 15 Nov 2002 12:51:24 -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 9483 invoked by uid 98); 15 Nov 2002 12:51:23 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <018701c28ca5$8c334d20$2701a8c0@spiritsoft.com> From: "James Strachan" To: "Jakarta Commons Developers List" , References: <4477.24.159.99.74.1037326593.squirrel@www.mercunet.net> Subject: Re: [DBUtils] Introduction and some thoughts Date: Fri, 15 Nov 2002 12:50:14 -0000 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.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N From: "Mike Bryant" > Hello all, > > My name is Mike Bryant. I just wanted to send an email to introduce > myself and say that I am excited about the DBUtils package. I've spent a > good bit of time at my current job writing database utility code, a > package like this could have really saved some time. > > The code so far looks great I think. I am especially impressed with the > EnhancedResultSet class and the DbUtils.resultSetToArray method. > > Some thoughts I have on this package: > - Data class (ColumnData) to hold a DB field's data. This might contain > data like column index, data type, column name, value. In the commons-sql project I used a DynaBean to hold a row of data from a database. See the bottom of this page for it in action.. http://jakarta.apache.org/commons/sandbox/sql/ A DynaBean has a DynaClass and a DynaProperty for the metadata. So I just implemented an SqlDynaBean, SqlDynaClass and SqlDynaProperty so that the additional database-specific metadata can be captured (SQL types, primary keys, indices, auto-increment, nullable, foreign keys etc). http://jakarta.apache.org/commons/sandbox/sql/apidocs/org/apache/commons/sql /dynabean/package-summary.html e.g. an SqlDyanBean has a collection of SqlDynaProperty objects each of which refers to a Column definition... http://jakarta.apache.org/commons/sandbox/sql/apidocs/org/apache/commons/sql /model/Column.html would that do for now? > - Method (similar to DbUtils.resultSetToArray method) that would build a > List (or maybe Map) of ColumnData objects. This might be useful if users > need more information than the resultSetToArray method provides. Already the beanutils project has a way of turning a ResultSet into an Iterator over DynaBeans which is quite useful. > - Method to take a SQL stmt as a param, execute it, build a List of > ColumnData objects (or a List of Strings), representing a vertical list of > column data. An example of this would be to use a stmt like 'select > user_name from users' to get a List of all users. FWIW the DynaSql class provides a way to preform queries and get the results back as an iterator over DyanBeans as well as to perform inserts and updates via DynaBeans. http://jakarta.apache.org/commons/sandbox/sql/apidocs/org/apache/commons/sql /dynabean/DynaSql.html James ------- http://radio.weblogs.com/0112098/ __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: