JDBC mediator serialization

The DataGraph produced by the JDBC DMS can be serialized and written out to a file, or sent across a network.

The following example illustrates serialization and de-serialization of a graph:
// This example assumes the creation of the Customer 
// metadata and the JDBC DMS.

DataObject object = mediator.getGraph();
DataGraph origGraph = object.getDataGraph();
  
FileOutputStream out = new FileOutputStream("test.datagraph");
ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(origGraph);
out.close();

FileInputStream in = new FileInputStream("test.datagraph");
ObjectInputStream oin = new ObjectInputStream(in);
DataGraph graph = (DataGraph) oin.readObject();
DataObject obj = (DataObject) graph.getRootObject();

// Now, the DataObject retrieved from the input stream 
// obj is equal to the original variable object put 
// through the output stream.



Related concepts
Java DataBase Connectivity Mediator Service
Reference topic Reference topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jan 16, 2013 3:37:33 AM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=rdat_sdoserialize
File name: rdat_sdoserialize.html