com.beasys.commerce.util
Class JdbcHelper
java.lang.Object
|
+--com.beasys.commerce.util.JdbcHelper
- public class JdbcHelper
- extends java.lang.Object
Constructor Summary |
JdbcHelper()
Helper constructor comment. |
Method Summary |
static java.lang.Object |
deserialize(java.sql.ResultSet rs,
int index)
Convenience method for de-serializing an object from a JDBC source. |
static void |
serialize(java.sql.PreparedStatement ps,
int index,
java.io.Serializable obj)
Convenience method for serializing an object to a JDBC stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
JdbcHelper
public JdbcHelper()
- Helper constructor comment.
serialize
public static void serialize(java.sql.PreparedStatement ps,
int index,
java.io.Serializable obj)
throws java.sql.SQLException,
java.io.IOException
- Convenience method for serializing an object to a JDBC stream.
Serializes the object and calls setBinaryStream() on the
prepared statement. The data will be written out later when
the statment is executed.
Note: getBinaryStream() requires the size of the data bytes,
so cannot use PipeInputStream, PipeOutputStream
- Parameters:
ps
- PreparedStatement.index
- placeholder index of the serialized object.obj
- Object to be serialized.
deserialize
public static java.lang.Object deserialize(java.sql.ResultSet rs,
int index)
throws java.sql.SQLException,
java.io.IOException,
java.io.StreamCorruptedException,
java.lang.ClassNotFoundException
- Convenience method for de-serializing an object from a JDBC source.
Note: This method may be able to use PipedOutputStream and PipedInputStream.
- Parameters:
ps
- Result Set.index
- table column index.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved