高分征求上传图片到oracle数据库里面的bean Unicorn008(菜之鸟) 加油呀!等着呢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 最好不要把图片直接放到数据库面,会影响速度,放路径吧,我这里有程序,是使用smartupload的,而且为了防止图片重名,把图片更名为当前的系统时间。<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %><%@ page import="com.jspsmart.upload.*"%><%@ page import="java.text.SimpleDateFormat"%><jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" /><% mySmartUpload.initialize(pageContext); mySmartUpload.upload(); java.util.Enumeration e = mySmartUpload.getRequest().getParameterNames(); int k=0; String truevalue[]; truevalue=new String[11]; while (e.hasMoreElements()) { String key = (String)e.nextElement(); String[] values = mySmartUpload.getRequest().getParameterValues(key); truevalue[k]=values[0]; k++; if (k==11){ int count=0; for (int i=0;i<mySmartUpload.getFiles().getCount();i++){ com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i); if (!myFile.isMissing()) { SimpleDateFormat formattime=new SimpleDateFormat("hhmmss"); SimpleDateFormat formatdate=new SimpleDateFormat("yyyyMMdd"); String filename=(String)formatdate.format(new java.util.Date())+(String)formattime.format(new java.util.Date())+"."+myFile.getFileExt(); myFile.saveAs("/upload/" + filename); count ++; String strSQL="insert into yourtable(vcPath) values ('"+filename +"')"; //out.print(strSQL+"<br><br>"); workM.executeUpdate(strSQL); } } } }%> 为了编个个程序时间全浪费了,希望强人能帮帮我 web 打印 求一个JSTL的截取字符串方案 各位大侠,用Java实现网络拓扑结构图有什么好的办法没? JSP的注册页面问题; document.form 帮我解决了,狂给分呀,高手快来吧 jsp中怎么判断下载是否成功? SimpleDateFormat方法需要用到哪些包或者方法啊? XXX.jsp?provence=吉林 问号后面地参数是干什么用的? 怎么实现基于jsp+oracle的网上投票程序,给小弟说说思想. 动态增加删除列的问题 给单服务器写的jsp程序 能轻松移植到服务器机群上么?
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %>
<%@ page import="com.jspsmart.upload.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<%
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
java.util.Enumeration e = mySmartUpload.getRequest().getParameterNames(); int k=0;
String truevalue[];
truevalue=new String[11];
while (e.hasMoreElements()) {
String key = (String)e.nextElement();
String[] values = mySmartUpload.getRequest().getParameterValues(key);
truevalue[k]=values[0];
k++;
if (k==11){ int count=0;
for (int i=0;i<mySmartUpload.getFiles().getCount();i++){
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);
if (!myFile.isMissing()) {
SimpleDateFormat formattime=new SimpleDateFormat("hhmmss");
SimpleDateFormat formatdate=new SimpleDateFormat("yyyyMMdd");
String filename=(String)formatdate.format(new java.util.Date())+(String)formattime.format(new java.util.Date())+"."+myFile.getFileExt();
myFile.saveAs("/upload/" + filename);
count ++;
String strSQL="insert into yourtable(vcPath) values ('"+filename +"')";
//out.print(strSQL+"<br><br>");
workM.executeUpdate(strSQL);
}
} }
}
%>