jaxb Object to Clob을 만드는 방법. 내가 다음과 같은 직렬화 할 수없는 오류가 오면.JAXB Object to Clob
public static void createClob(TestTo testTo){
PreparedStatement pst = null;
Connection con = null;
//Clob studentListClob = null;
try {
con = openOASDBcon(false);
pst = con.prepareCall(INSERT_Clob);
pst.setBytes(1, getByteArrayObject(testTo));
pst.setString(2, "");
pst.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
close(con, pst);
}
}
private static byte[] getByteArrayObject(TestTo testTo){
byte[] byteArrayObject = null;
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(testTo);
oos.close();
bos.close();
byteArrayObject = bos.toByteArray();
} catch (Exception e) {
e.printStackTrace();
return byteArrayObject;
}
return byteArrayObject;
}
직렬화를 구현할 수 없습니다. clob에 jaxb 객체를 구현하는 가장 좋은 방법이 있습니까?
JAXB에서 Serializable 클래스를 만드는 방법을 묻는 것처럼 보입니다. 이 경우 http://stackoverflow.com/questions/1513972/how-to-generate-a-java-class-which-implements-serializable-interface-from-xsd-us – Rob
직렬화 할 수있을뿐만 아니라 다음을 참조하십시오. jaxb 객체를 clob로 변환하고 싶습니다. 할 수있는 방법이 있습니까? – jackyesind
@Rob. 할 수있는 방법이 있습니까? – jackyesind