亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

一段下載功能的代碼

系統 1683 0
public ?ActionForward?download(ActionMapping?mapping,?ActionForm?form,
????????????HttpServletRequest?request,?HttpServletResponse?response)
????????????
throws ?Exception? ... {
????????
this .initActionAttributes(request);
????????
// System.out.println(uploadForm.getFile().getFileName()+"--size?is?--"+uploadForm.getFile().getFileSize());
????????String?tables = new ?String(request.getParameter( " TABLE_NAME " ).getBytes( " ISO8859_1 " ));
????????String?table
= new ?String(request.getParameter( " TABLE " ).getBytes( " ISO8859_1 " ));
????????String?con
= new ?String(request.getParameter( " SQL_COND " ).getBytes( " ISO8859_1 " ));
????????String?col
= new ?String(request.getParameter( " TITLE_CODE " ).getBytes( " ISO8859_1 " ));
????????String?colName
= new ?String(request.getParameter( " TITLE_NAME " ).getBytes( " ISO8859_1 " ));
????????String?rowNum
= new ?String(request.getParameter( " ROW_NUM " ).getBytes( " ISO8859_1 " ));
????????String[]?columnName?
= ?colName.split( " , " );
????????StringBuffer?sb
= new ?StringBuffer();
????????sb.append(
" select? " ).append(col).append( " ?from? " ).append(tables).append( " ?where? " ).append(con).append( " ?order?by?(cust.BUSY_IN_CALL_DURATION?+?cust.IDLE_IN_CALL_DURATION)?desc?fetch?first? " + rowNum + " ?rows?only " );
????????StringBuffer?updateSql
= new ?StringBuffer();
????????updateSql.append(
" update? " ).append(table).append( " ?set?DOWNLOAD_MARK=1,DOWNLOAD_TIME=current?Date?where?comp_product_no?in(select?cust.comp_product_no?from?DMCF_cust_ms?cust " ).append( " ?where? " ).append(con).append( " ?order?by?(cust.BUSY_IN_CALL_DURATION?+?cust.IDLE_IN_CALL_DURATION)?desc?fetch?first? " + rowNum + " ?rows?only) " );
????????String?fileName?
= ? " CustInfo " ? +
????????
new ?SimpleDateFormat( " yyyyMMddHHmmss " ).format( new ????java.util.Date())? + ? " .csv " ;
?????????PrintWriter?pw?
= ? null ;
?????????Sqlca?m_Sql?
= ? null ;
// ???????保存到客戶機上
?????????response.setContentType( " application/octet-stream;?charset=gbk " );
?????????response.setHeader(
" Content-disposition " ,? " attachment;?filename=" " ? + ?fileName? + ? " " " );
?????????PrintWriter?out1?
= ? null ;
?????????
try ? ... {

?????????????pw?
= ? new ?PrintWriter( new ?FileOutputStream(fileName));
?????????????out1?
= ?response.getWriter();
?????????????
// 標題vector
?????????????Vector?titleVector? = ? new ?Vector();
?????????????
for ?( int ?i? = ? 0 ;?i? < ?columnName.length;?i ++ )? ... {
?????????????????titleVector.add(columnName[i]);
?????????????}

?????????????
for ?( int ?j? = ? 0 ;?j? < ?titleVector.size();?j ++ )? ... {
?????????????????out1.print(
new ?String(String.valueOf(titleVector.elementAt(j)).getBytes( " gbk " )));
?????????????????
if ?(j? == ?titleVector.size()? - ? 1 )
?????????????????????out1.println();
?????????????????
else
?????????????????????out1.print(
" , " );
?????????????????out1.flush();
?????????????}

?????????????
?????????????m_Sql?
= ? new ?Sqlca( new ?ConnectionEx(Const.DATASOURCE));

?????????????m_Sql.execute(sb.toString());
?????????????String?tmpStr;
?????????????
while ?(m_Sql.next())? ... {
?????????????????
?????????????????
for ?( int ?j? = ? 1 ;?j? <= ?titleVector.size();?j ++ )? ... {
?????????????????????tmpStr?
= ? "" ? + ?m_Sql.getString(j);
?????????????????????out1.write(
new ?String(tmpStr.getBytes( " gbk " )));
?????????????????????
if ?(j? == ?titleVector.size())
?????????????????????????out1.println();
?????????????????????
else
?????????????????????????out1.print(
" , " );
?????????????????}

?????????????????out1.flush();
?????????????}

????????????m_Sql.execute(updateSql.toString());
????????????m_Sql.commit();
????????????
?????????}
? catch ?(Exception?exception)? ... {
?????????????m_Sql.rollback();
?????????????
if (m_Sql? != ? null )m_Sql.closeAll();
?????????????exception.printStackTrace();
?????????}
? finally ? ... {
?????????????
if (m_Sql? != ? null )m_Sql.closeAll();
?????????????
?????????}

????????
????????
return ?mapping.findForward( " initAction " );
????}
?

一段下載功能的代碼


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久久久久不卡 | 夜间福利在线观看 | 天天干天天爱天天操 | 特级做人爱c级特级aav毛片 | 在线观看麻豆精品国产不卡 | 国产中的精品一区的 | 91色蝌蚪| 久久精品免费一区二区视 | 四虎新地址 | 久久精品国产欧美日韩亚洲 | 久久久久18 | 69日本人xxxx16—18 | 国产精品久久久久国产精品 | 久草在线免费看视频 | 九九热观看视频 | 青青草一区二区免费精品 | 66精品综合久久久久久久 | 在线观看视频国产 | 精品一区二区三区亚洲 | 99久久99久久久99精品齐 | 久久婷婷五月综合色丁香 | 成人毛片免费观看视频大全 | 欧美一级毛片视频 | 91福利合集 | 久久久久久999 | 青青青青青青久久久免费观看 | 在线观看免费精品国产 | 一级做受毛片免费大片 | 日韩中文字幕精品免费一区 | 日日艹夜夜艹 | 国产精品视频免费播放 | 六月丁香深爱六月综合激情 | 欧美黄色录像视频 | 日韩欧美综合在线二区三区 | 伊人久久99亚洲精品久久频 | 在线免费观看视频a | 黄色在线免费看 | 香蕉综合在线 | 成人深夜网站 | 中文字幕在线欧美 | 97视频免费观看 |