日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁 > > 充電吧
[導(dǎo)讀]首先將要導(dǎo)出的數(shù)據(jù)庫表的數(shù)據(jù)封裝到一個list集合中,然后循環(huán)遍歷該list集合再應(yīng)用jxl組件將這些數(shù)據(jù)寫入excel文件。?001package com.ybhacker.mailbox.util

首先將要導(dǎo)出的數(shù)據(jù)庫表的數(shù)據(jù)封裝到一個list集合中,然后循環(huán)遍歷該list集合

再應(yīng)用jxl組件將這些數(shù)據(jù)寫入excel文件。

?

001package com.ybhacker.mailbox.util;002?003import java.io.File;004import java.util.List;005?006import jxl.*;007import jxl.format.Alignment;008import jxl.format.Colour;009import jxl.format.UnderlineStyle;010import jxl.format.VerticalAlignment;011import jxl.write.Label;012import jxl.write.WritableFont;013import jxl.write.WritableSheet;014import jxl.write.WritableWorkbook;015?016import com.ybhacker.mailbox.model.BoxList;017?018/**019?* Excel操作020?* 021?* @author Windows7022?* 023?*/024public classExcelOperationUtil {025?026????/**027?????* 保存數(shù)據(jù)內(nèi)容到excel028?????* @param list029?????* @param savepath030?????* @return031?????*/032?033????publicboolean readDataToExcelFile(List034????????try{035????????????WritableWorkbook book = Workbook.createWorkbook(newFile(savepath));036????????????WritableSheet sheet = book.createSheet("SHELL",0);037????????????// 設(shè)置字體樣式038????????????jxl.write.WritableFont font =new jxl.write.WritableFont(039????????????????????WritableFont.ARIAL,15, WritableFont.BOLD, false,040????????????????????UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.GREEN);041????????????jxl.write.WritableCellFormat cellFormat =new jxl.write.WritableCellFormat(042????????????????????font);043????????????cellFormat.setAlignment(Alignment.CENTRE);044????????????cellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);// 設(shè)置單元格內(nèi)容兩端對齊045????????????cellFormat.setBackground(Colour.GRAY_25);// 背景顏色046????????????Label label_title =new Label(0,0, "WEBSHELL收信箱子系統(tǒng)V2.0",047????????????????????cellFormat);048????????????sheet.mergeCells(0,0, 4,0);// 合并第一行的第1個到第5個單元格049????????????sheet.setRowView(0,600, false);// 設(shè)置第一行的行高050?051????????????Label label_id =new Label(0,1, "ID");052????????????Label label_url =new Label(1,1, "木馬地址");053????????????Label label_script =new Label(2,1, "腳本類型");054????????????Label label_pass =new Label(3,1, "密碼");055????????????Label label_host =new Label(4,1, "域名");056????????????Label label_google =new Label(5,1, "谷歌權(quán)重");057????????????Label label_baidu =new Label(6,1, "百度權(quán)重");058????????????Label label_indexed =new Label(7,1, "收錄總數(shù)");059????????????Label label_createtime =new Label(8,1, "創(chuàng)建時間");060????????????Label label_sell =new Label(9,1, "是否出售");061?062????????????sheet.setColumnView(4,15);// 設(shè)置列寬063????????????sheet.addCell(label_title);064????????????sheet.addCell(label_id);065????????????sheet.addCell(label_url);066????????????sheet.addCell(label_script);067????????????sheet.addCell(label_pass);068????????????sheet.addCell(label_host);069????????????sheet.addCell(label_google);070????????????sheet.addCell(label_baidu);071????????????sheet.addCell(label_indexed);072????????????sheet.addCell(label_createtime);073????????????sheet.addCell(label_sell);074?075????????????for(int i = 0; i < list.size(); i++) {// 遍歷數(shù)據(jù)對象的集合,將所有信息導(dǎo)出到Excel076????????????????BoxList temp = (BoxList) list.get(i);077????????????????String script ="未知";078????????????????String createtime = temp.getnCreateTime().toString();079????????????????if(temp.getnScript() == 1) {080????????????????????script ="ASP";081????????????????}082????????????????if(temp.getnScript() == 2) {083????????????????????script ="PHP";084????????????????}085????????????????if(temp.getnScript() == 3) {086????????????????????script ="ASPX";087????????????????}088????????????????if(temp.getnScript() == 4) {089????????????????????script ="JSP";090????????????????}091????????????????String Sell ="正常";092????????????????if(temp.isnSell()) {093????????????????????Sell ="已售";094????????????????}095????????????????Label id_value =new Label(0, i +2, temp.getId() + "");096????????????????Label url_value =new Label(1, i +2, temp.getnUrl());097????????????????Label script_value =new Label(2, i +2, script);098????????????????Label pass_value =new Label(3, i +2, temp.getnPass());099????????????????Label host_value =new Label(4, i +2, temp.getnHost());100????????????????Label google_value =new Label(5, i +2, temp.getnGoogle());101????????????????Label baidu_value =new Label(6, i +2, temp.getnBaidu());102????????????????Label indexed_value =new Label(7, i +2, temp.getnIndexed());103????????????????Label createtime_value =new Label(8, i +2, createtime);104????????????????Label sell_value =new Label(9, i +2, Sell);105?106????????????????sheet.addCell(id_value);107????????????????sheet.addCell(url_value);108????????????????sheet.addCell(script_value);109????????????????sheet.addCell(pass_value);110????????????????sheet.addCell(host_value);111????????????????sheet.addCell(google_value);112????????????????sheet.addCell(baidu_value);113????????????????sheet.addCell(indexed_value);114????????????????sheet.addCell(createtime_value);115????????????????sheet.addCell(sell_value);116?117????????????}118????????????book.write();119????????????book.close();120????????????returntrue;121????????} catch (Exception e) {122????????????System.out.println("異常信息:"+ e.getMessage());123????????????e.printStackTrace();124????????????returnfalse;125????????}126????}127}

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除。
換一批
延伸閱讀

北京——2025年8月15日,亞馬遜云科技日前宣布,Amazon DocumentDB Serverless已正式可用,這是Amazon DocumentDB(兼容MongoDB)的一種全新配置,能夠根據(jù)應(yīng)用程序需求自動...

關(guān)鍵字: 數(shù)據(jù)庫 服務(wù)器

濟(jì)南2025年8月12日 /美通社/ -- 近年來,國家大力推進(jìn)信創(chuàng)產(chǎn)業(yè)發(fā)展,明確要求關(guān)鍵行業(yè)信息系統(tǒng)實(shí)現(xiàn) "自主可控、安全可靠",老年教育領(lǐng)域作為民生服務(wù)的重要陣地,其信息化建設(shè)的國產(chǎn)化適配已成為行...

關(guān)鍵字: 全棧 BSP 數(shù)據(jù)庫 加密

助力企業(yè)更快、更輕松地遷移VMware工作負(fù)載,無需重構(gòu)應(yīng)用或變更架構(gòu)

關(guān)鍵字: 云服務(wù) 生成式AI 數(shù)據(jù)庫

在云計算與數(shù)據(jù)庫高可用場景中,LVM(Logical Volume Manager)的動態(tài)擴(kuò)展能力已成為保障業(yè)務(wù)連續(xù)性的關(guān)鍵技術(shù)。某金融企業(yè)通過LVM在線擴(kuò)容將數(shù)據(jù)庫停機(jī)時間從2小時縮短至30秒,但操作不當(dāng)仍可能導(dǎo)致數(shù)據(jù)...

關(guān)鍵字: LVM 數(shù)據(jù)庫

北京 2025年7月10日 /美通社/ -- 全球向量數(shù)據(jù)庫的先行者Zilliz利用亞馬遜云科技的生成式AI技術(shù)與云服務(wù),為全球企業(yè)及開發(fā)者提供高可擴(kuò)展、安全穩(wěn)定的向量數(shù)據(jù)庫解決方案,助力企業(yè)全面釋放數(shù)據(jù)潛能。此外,依...

關(guān)鍵字: 亞馬遜 向量 數(shù)據(jù)庫 AI

n8n是一個連接API、數(shù)據(jù)庫和服務(wù)的開源工作流自動化平臺。實(shí)際上,它允許非程序員使用可視化界面構(gòu)建復(fù)雜的系統(tǒng),同時為開發(fā)人員提供強(qiáng)大且可擴(kuò)展的自動化設(shè)計方法。它是部署AI代理、結(jié)合觸發(fā)器、語言模型(llm)和外部工具的...

關(guān)鍵字: n8n API 數(shù)據(jù)庫 ESP32

上海 2025年6月20日 /美通社/ -- 在2025亞馬遜云科技中國峰會上,全球知名的汽車制造商長城汽車宣布應(yīng)用亞馬遜云科技Amazon Connect構(gòu)建全球聯(lián)絡(luò)中心,實(shí)現(xiàn)了全球客服從統(tǒng)一渠道、客戶投訴分級與跟進(jìn)...

關(guān)鍵字: 亞馬遜 汽車 NEC 數(shù)據(jù)庫

或者,如果你是一家企業(yè),你在業(yè)務(wù)中使用某種工具的頻率是多少?操作那臺機(jī)器的費(fèi)用是多少?敏感實(shí)驗室設(shè)備周圍的電壓有多穩(wěn)定?你所在位置接收到的電能質(zhì)量如何?例如,您可以使用這些信息來更好地估計產(chǎn)品成本,或者通過進(jìn)行異常檢測或...

關(guān)鍵字: Web應(yīng)用程序 樹莓派 數(shù)據(jù)庫

上?!?025年6月20日 在2025亞馬遜云科技中國峰會上,全球知名的汽車制造商長城汽車宣布應(yīng)用亞馬遜云科技Amazon Connect構(gòu)建全球聯(lián)絡(luò)中心,實(shí)現(xiàn)了全球客服從統(tǒng)一渠道、客戶投訴分級與跟進(jìn)、閉關(guān)管理到統(tǒng)計考...

關(guān)鍵字: 計算 存儲 數(shù)據(jù)庫

在現(xiàn)代軟件系統(tǒng)中,數(shù)據(jù)庫與緩存是兩個重要的組成部分。數(shù)據(jù)庫負(fù)責(zé)數(shù)據(jù)的持久化存儲,而緩存則用于加速數(shù)據(jù)訪問速度。然而,如何保證數(shù)據(jù)庫與緩存之間數(shù)據(jù)的一致性是一個具有挑戰(zhàn)性的問題。本文將探討數(shù)據(jù)庫與緩存數(shù)據(jù)一致性問題,并關(guān)注...

關(guān)鍵字: 緩存 數(shù)據(jù)庫
關(guān)閉