8 messages in com.mysql.lists.javaRe: NotSerializeable Exception| From | Sent On | Attachments |
|---|---|---|
| Dave Newton | 21 Feb 2003 08:48 | |
| Antoni Unkovich | 24 Feb 2003 18:52 | |
| Dirk Hillbrecht | 25 Feb 2003 00:41 | |
| Jeff Mathis | 25 Feb 2003 08:27 | |
| Christopher Taylor | 25 Feb 2003 09:15 | |
| Antoni Unkovich | 25 Feb 2003 11:05 | |
| Graham Davidson | 25 Feb 2003 13:30 | |
| Jeff Mathis | 25 Feb 2003 15:36 |
| Subject: | Re: NotSerializeable Exception![]() |
|---|---|
| From: | Christopher Taylor (csta...@nanshu.com) |
| Date: | 02/25/2003 09:15:04 AM |
| List: | com.mysql.lists.java |
There's a better way to do this anyways. You should only be storing the primary keys of those order items, plus any additional, non-product meta-data that you want to track with the order.
With the way it is now, you won't be able to search on those serialized fields without pulling them out of the database first.
-Chris
----- Original Message ----- From: "Dirk Hillbrecht" <dh...@chitec.de> To: <ant...@innova.co.nz> Cc: <ja...@lists.mysql.com> Sent: Tuesday, February 25, 2003 12:41 AM Subject: Re: NotSerializeable Exception
Hello,
Can someone please point out where I'm going wrong here; I'm trying to save a Java object into MySQL.
[...]
---------------------------------------- # my code
OrderInfo info = (OrderInfo)session.getAttribute("orderInfo"); Hashtable shoppingCart = (Hashtable)session.getAttribute("shoppingCart");
PreparedStatement ps = con.prepareStatement("INSERT into orders SET OrderID=?,OrderInfo=?,ShoppingCart=?,DateCreated=?");
ps.setString(1, "null" ); ps.setObject(2, info ); ps.setObject(3, shoppingCart );
Almost surely your Hashtable "shoppingCart" contains something non-serializable.
Best regards, Dirk
-- --- Dirk Hillbrecht, chitec OHG, Vahrenwalder Str. 7/TCH, 30165 Hannover ----- Tel.: +49/511/9357-840, Fax: +49/511/9357-849 ----- eMail: dh...@chitec.de, Web: http://www.chitec.de --- PGP fingerprint: 71D8 A381 2B69 144B DABA 78A5 D398 1792 D270 13D7
--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/doc/ (the manual) http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <java...@lists.mysql.com> To unsubscribe, e-mail <java-unsubscribe-cstaylor=nans...@lists.mysql.com>




