Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 4288 invoked from network); 15 Aug 2007 06:26:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Aug 2007 06:26:52 -0000 Received: (qmail 41106 invoked by uid 500); 15 Aug 2007 06:26:49 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 40672 invoked by uid 500); 15 Aug 2007 06:26:48 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Delivered-To: moderator for derby-user@db.apache.org Received: (qmail 87900 invoked by uid 99); 14 Aug 2007 14:38:33 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Mime-Version: 1.0 X-Sender: dpl1n@pop-server.CENT.GLA.AC.UK Message-Id: In-Reply-To: <46BC2F0B.2060209@sun.com> References: <46BC2F0B.2060209@sun.com> Date: Tue, 14 Aug 2007 15:38:01 +0100 To: derby-user@db.apache.org, Thomas Nielsen From: David Leader Subject: MysSQL to Derby (was Accessing embedded database in JAR file) Cc: btrichardson@gmail.com Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Virus-Checked: Checked by ClamAV on apache.org I wrote: > >>Despite a few problems in porting the stuff from MySQL, I must say >>that overall I'm very pleased with the result. My thanks to the >>Derby team. And Thomas replied: >Thanks for letting the community know :) > >If you don't mind - what were your top three pains when moving from >MySQL to Derby? Glad to, if it will be of any interest, although the problems were probably a result of our* own inexperience and naivity. 1. We used DdlUtils to do the migration, did the conversion form MySQL to xml ok, but then encountered errors on conversion to Derby. These threw us initially because they related to primary keys not being unique, but eventually we realized that this was because MediumInt is only supported in MySQL and the conversion changed it to a Small integer. I guess we should have inspected the xml schema more carefully. I had consulted the page: http://db.apache.org/ddlutils/databases/mysql.html And my one suggestion here is that the conversion table on that page should include the recasting of mediumint - presumably an oversight. 2. The other problems arose at runtime after apparent successful conversion, and also arose from the non-standard nature of MySQL. There were three aspects of the java code of my app that Derby took exception to. One was a JDBC ResultSet method (first()) I had used in a hack to check for empty tables. It turned out Derby didn't like this and made me use some JDBC2 method for scrolling the table. It also wouldn't allow a finally{} clause for closing a connection that it already handled itself (easy enough to remove) and wouldn't allow a faulty SQL query that MySQL had ignored (typo of GROUP instead of ORDER - for the correction of which I thank it). So the moral is perhaps that Derby is to MySQL as Java is to Perl - it won't tolerate the sloppy habits you had become accustomed to. :-) (Apologies to the Perl community) 3. Finally, my enthusiasm to produce a neatly packaged product made me (and my app) waste time with the zipped database. Perhaps there could be a health warning about this somewhere. David * 'Our' because a summer student was doing this as part of a Masters project, but I needed to help him debug it. -- _______________________________________________________________ David P.Leader, Biochemistry and Molecular Biology Davidson Building, University of Glasgow, Glasgow G12 8QQ, UK Phone: +44 41 330-5905 http://doolittle.ibls.gla.ac.uk/leader _______________________________________________________________