Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 6808 invoked from network); 4 May 2007 10:53:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 May 2007 10:53:43 -0000 Received: (qmail 88963 invoked by uid 500); 4 May 2007 10:53:48 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 88923 invoked by uid 500); 4 May 2007 10:53: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 Received: (qmail 88912 invoked by uid 99); 4 May 2007 10:53:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2007 03:53:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [195.121.247.23] (HELO psmtp09.wxs.nl) (195.121.247.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2007 03:53:41 -0700 Received: from localhost ([62.12.11.2]) by psmtp09.wxs.nl (iPlanet Messaging Server 5.2 HotFix 2.15 (built Nov 14 2006)) with ESMTP id <0JHI001DIJKVRJ@psmtp09.wxs.nl> for derby-user@db.apache.org; Fri, 04 May 2007 12:53:19 +0200 (MEST) Date: Fri, 04 May 2007 12:53:19 +0200 From: "Bernt M. Johnsen" Subject: Re: Insert JAVA_OBJECT in embedded Derby DB In-reply-to: <25f4ddd90705040202o47ed56c6r77b4e95aa7a8df89@mail.gmail.com> To: Derby Discussion Message-id: <20070504105319.GA5847@localhost.localdomain> Organization: Sun Microsystems MIME-version: 1.0 Content-type: multipart/signed; boundary=9amGYk9869ThD9tj; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-disposition: inline User-Agent: Mutt/1.5.11 References: <25f4ddd90705040202o47ed56c6r77b4e95aa7a8df89@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable You need to serialize the object. One way of doing it is like this: ByteArrayOutputStream bos =3D new ByteArrayOutputStream(); ObjectOutputStream oos =3D new ObjectOutputStream(bos); oos.writeObject(item); oos.close(); ps.setBytes(1, bos.toByteArray()); An vice versa when you retrive the object :-) --=20 Bernt Marius Johnsen, Database Technology Group,=20 Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems, Trondheim, Norway --9amGYk9869ThD9tj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFGOxCflFBD9TXBAPARAoMZAKCLZNKkjDGBJ7xOBK/bnRtbWQIYqQCgnU9z PN4kIyjCUEQfAPLM3mDWs5A= =boWs -----END PGP SIGNATURE----- --9amGYk9869ThD9tj--