可以把你的文件读入流里,然后把它保存为BLOB类型:........
BLOB lBlob = (oracle.sql.BLOB)lRS.getBlob(rIndex);
//lRS is ResultSet object,rIndex is the column indexOutputStream lOut = lBlob.getBinaryOutputStream();
//String lPicPath = "C:\\API\\google.gif";
String lFilePath = "c:\\your.txt"
FileInputStream lFIS = new FileInputStream(lFilePath);
int lC;
while((lC=lFIS.read()) != -1)
{
lOut.write(lC);
}
lFIS.close();
lOut.close();
lRS.updateBlob(rIndex, lBlob);
lRS.updateRow();
..........
BLOB lBlob = (oracle.sql.BLOB)lRS.getBlob(rIndex);
//lRS is ResultSet object,rIndex is the column indexOutputStream lOut = lBlob.getBinaryOutputStream();
//String lPicPath = "C:\\API\\google.gif";
String lFilePath = "c:\\your.txt"
FileInputStream lFIS = new FileInputStream(lFilePath);
int lC;
while((lC=lFIS.read()) != -1)
{
lOut.write(lC);
}
lFIS.close();
lOut.close();
lRS.updateBlob(rIndex, lBlob);
lRS.updateRow();
..........
<%@ include file="你的.txt" %>
然后在写入数据库