java 序列化数据到mysql数据库中的方法,有需要的朋友可以参考下。
注:使用hibernate跟数据库打交道。
hibernate配置文件如下
复制代码 代码如下:
/p>
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
com.mysql.jdbc.Driver
jdbc:mysql://localhost:3306/test
true
utf-8
root
you_password
org.hibernate.connection.C3P0ConnectionProvider
20
1
1800
100
500
2
true
select 1
18000
25000
true
org.hibernate.dialect.MySQLInnoDBDialect
update
true
true
hibernate映射文件
复制代码 代码如下:
/p>
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
hibernate实体类</