首页>代码>采用struts2+hibernate实现保存文件到Oracle数据库&&并附下载代码【导入即可用】;数据库中保存blob类型的二进制文件>/blob_hibernate/src/org/entity/Testblob.java
package org.entity; import java.math.BigDecimal; import java.sql.Blob; /** * Testblob entity. @author MyEclipse Persistence Tools */ public class Testblob implements java.io.Serializable { // Fields private Integer rid; private String title; private String contentType; private Blob data; // Constructors /** default constructor */ public Testblob() { } /** full constructor */ public Testblob(String title,String contentType, Blob data) { this.title = title; this.contentType = contentType; this.data = data; } // Property accessors public Integer getRid() { return this.rid; } public void setRid(Integer rid) { this.rid = rid; } public String getTitle() { return this.title; } public void setTitle(String title) { this.title = title; } public Blob getData() { return this.data; } public void setData(Blob data) { this.data = data; } public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } }