Obiect Serialization and Persistence 对象序列化和持久化 Institute of Computer Software 2021/1/28 Nanjing University
对象序列化和持久化 Object Serialization and Persistence 2021/1/28 Institute of Computer Software Nanjing University 1
最病 过摘要 口对象序列化 口对象持久化 a language level a Databases Hibernate Institute of Computer Software 2021/1/28 Nanjing University
摘要 对象序列化 对象持久化 Language level Databases Hibernate 2021/1/28 Institute of Computer Software Nanjing University 4
最病 ○ bject Serialization 5 口Why a What 口HoW Institute of Computer Software 2021/1/28 Nanjing University
Object Serialization Why What How 2021/1/28 Institute of Computer Software Nanjing University 5
最病 A Java Object Serialization --Why 6 a Serialization is used for light weight persistence and for communication via sockets or remote method Invocation (RMI) Institute of Computer Software 2021/1/28 Nanjing University
Java Object Serialization -- Why Serialization is used for lightweight persistence and for communication via sockets or Remote Method Invocation (RMI). 2021/1/28 Institute of Computer Software Nanjing University 6
最病 A Java Object Serialization --Example 7 public class Client public static void main( String args[) try(//Create a socket Socket soc new Socket(Inet Address getLocalHost(), 8020) ○ utput Strean。= soc. get Output Stream(); Object Output s new Object Output Stream(o); s write Object("Todays date"); swrite Object(new Date())i sclose();] catch(Exception e)t System. out. printIn(e get Message()) System. out. printIn (" Error during serialization") System. exit(1);] Institute of Computer Software 2021/1/28 Nanjing University
Java Object Serialization -- Example public class Client { public static void main(String args[]) { try { // Create a socket Socket soc = new Socket(InetAddress.getLocalHost(), 8020); OutputStream o = soc.getOutputStream(); ObjectOutput s = new ObjectOutputStream(o); s.writeObject("Today's date"); s.writeObject(new Date()); s.flush(); s.close(); } catch (Exception e) { System.out.println(e.getMessage()); System.out.println("Error during serialization"); System.exit(1); } } } 2021/1/28 Institute of Computer Software Nanjing University 7