2

I'm using the java encog library and wanted to know how to serialize the sample XOR network to a mysql database. I'm rather new to working with databases in java. I'm guessing it has to do with the EncogDirectoryPersist class but was wondering how to modify that to return something that can be sent to a database.

thanks

4

2 回答 2

0

It looks like you could just use normal java serialization to serialize to a byte array (look at using the commons-lang3 library to do this in one line with org.apache.commons.lang3.SerializationUtils.serialize(Serializable)), then store this in the database as a binary column.

于 2012-03-02T08:12:26.777 回答
0

Check that the class that you want to persist implements the Java Serializable interface. Then it is a simple matter to serialize that class using Java Serialization api to either a file or to a database if you desire that.

于 2012-03-02T19:09:31.510 回答