String Content = myUpload.getRequest().getParameter("txtContent");
oracle.sql.CLOB contentClob = ((oracle.jdbc.OracleResultSet)rsClob).getCLOB("Content");
Writer os = contentClob.getCharacterOutputStream();
os.write(Content);
os.flush();
os.close();
}
oracle.sql.CLOB contentClob = ((oracle.jdbc.OracleResultSet)rsClob).getCLOB("Content");
Writer os = contentClob.getCharacterOutputStream();
os.write(Content);
os.flush();
os.close();
}
解决方案 »
- EDI(Electronic Data Interchange)实施问题请教
- 怎样用json通过action的查询方法获取数据库里面的值?然后再通过页面接受? 急急急!
- 如何在进入页面时自动选中并加亮表格的每一行
- tomcat jsp 怪问题
- 把JSP页面中的数据导出到excel时出现乱码,是有时候出现乱码,有时候又是好的,什么原因??
- 用了一个转化汉字乱码的函数,但是出新问题
- 通过WebSphere访问一个html页面,中文显示乱码,急!。。。
- servlet中的forward问题(附源码)
- Eclipse里 Deploy Module 后没有更新Tomcat webapps里的内容
- 求救:tomcat怎么通过mm.mysql.jdbc连接mysql?
- 怎么在tomcat环境下配置显示applet哪
- 关于jsp中操纵表格的问题,大虾们帮忙!
http://expert.csdn.net/Expert/topic/876/876147.xml?temp=.870022
http://expert.csdn.net/Expert/topic/1339/1339835.xml?temp=.5663416<%@ page contentType="text/html;charset=gb2312" %>
<%@ page language="java" import="com.jspsmart.upload.*"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<jsp:useBean id="inewBean" scope="page" class="hitachi.news.inewBean" />
<HTML>
<BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 3</H1>
<HR>
<%// Variables
int count=0;
// Initialization
mySmartUpload.initialize(pageContext);
// Only allow txt or htm files
//mySmartUpload.setAllowedFilesList("htm,html,txt,,");
// DeniedFilesList can also be used :
// mySmartUpload.setDeniedFilesList("exe,bat,jsp");
// Deny physical path
// mySmartUpload.setDenyPhysicalPath(true);
// Only allow files smaller than 50000 bytes
// mySmartUpload.setMaxFileSize(50000);
// Deny upload if the total fila size is greater than 200000 bytes
// mySmartUpload.setTotalMaxFileSize(200000);
// Upload
mySmartUpload.upload();
// Save the files with their original names in a virtual path of the web server
try {
count = mySmartUpload.save("/pic/upload/news", mySmartUpload.SAVE_VIRTUAL);
String title=mySmartUpload.getRequest().getParameter("title");
String content=mySmartUpload.getRequest().getParameter("content");
String picture=mySmartUpload.getFiles().getFile(0).getFileName();inewBean.insert_news(title,content,picture);
} catch (Exception e){
out.println("<b>Wrong selection : </b>" + e.toString());
}
// Display the number of files uploaded
out.println(count + " file(s) uploaded."); %>
</BODY>
</HTML> <html>
<head>
</head>
<body>
<form METHOD="POST" ACTION="/hitachi/inews.jsp" ENCTYPE="multipart/form-data">
<table><tr>
<td>
标题
</td>
<td>
<input type="input" name="title"></input>
</td>
</tr><tr>
<td>
内容
</td>
<td>
<textarea name="content"></textarea>
</td>
</tr><tr>
<td>
图片
</td>
<td>
<input type="file" name="pic"></input>
</td>
</tr><tr>
<td>
</td>
<td>
<input type="submit" value="保存"></input>
</td>
</tr>
<table>
</form>
</body>
</html>
应该是
setAutoCommit(false)
inewBean.insert_news是怎么写的?
其中mySmartUpload是个bean:<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />表单用提交用<form method="post" enctype="multipart/form-data" action="upload.jsp">
发给我一份,我急用!!!!!!!!!!!!!!
int size = file.getSize();
System.out.println("received file.size:"+size);
byte[] content = new byte[size];
for(int i = 0; i < size; i++)
{
content[i] = file.getBinaryData(i);
}另外使用Oracle thin驱动存储Blob类型时最大文件大小好像是4k
应使用oci驱动,jdbc:oracle:oci8:@xx
我使用的是oci,有多大限制
www.jspsmart.com
谢谢你的建议,很不错的网站,请问
例子中的jsp写成bean的话,mySmartUpload.initialize(pageContext)出错
请问怎么解决?
帮我解决一下问题(已发邮件给你!)
有哪些servlet包需要?望指点!