8 messages in com.mysql.lists.javaRe: NotSerializeable Exception
FromSent OnAttachments
Dave Newton21 Feb 2003 08:48 
Antoni Unkovich24 Feb 2003 18:52 
Dirk Hillbrecht25 Feb 2003 00:41 
Jeff Mathis25 Feb 2003 08:27 
Christopher Taylor25 Feb 2003 09:15 
Antoni Unkovich25 Feb 2003 11:05 
Graham Davidson25 Feb 2003 13:30 
Jeff Mathis25 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

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

To request this thread, e-mail <java@lists.mysql.com> To unsubscribe, e-mail <java-unsubscribe-cstaylor=nans@lists.mysql.com>