首页 数据库 SQLServer     /    数据库大量数据导出Excel

数据库大量数据导出Excel

上传者: shanhuijava | 上传时间:2025/12/4 20:31:48 | 文件大小:11.18MB | 文件类型:zip
数据库大量数据导出Excel
应客户要求,导出数据库中的数据为Excel,只在一个Sheet中,Excel中的内容要与数据库里的内容一致(主要针对日期型数据)。
由于之前接触过POI,对POI的一些特性还是有一定的了解的,因此顺其自然的用POI去解决这个问题。
POI3.8版本之前的版本处理大量数据的导出Excel效果不是很理想,主要在与Excel2003版本单个Sheet的行限制为65536,大量数据的导出得分多个Sheet,针对这一点,客户就不会满意。
其次,在实验过程中,大数据量的导出很容易引发内存溢出,调整JVM的内存大小治标不治本。
很多人建议保存为.CSV格式的文件。
不过,.CSV方式导出也存在问题:首先,如果用excel来打开csv,超过65536行的数据都会看不见,这是Excel程序的问题。
其次,如果要导出一个身份证号码,手机号码等纯数字构成的字符串,在excel中打开csv时,这些字段很容易被识别成数字,被误处理。
POI3.8以后的版本支持Excel2007高版本,单个Sheet的行数可达到百万,针对内存溢出问题,可通过设置内存数据保留数,每当计数到指定的数值时,刷新数据到硬盘,清理内存。
本软件ID:6281351

文件下载

资源详情

[{"title":"(21个子文件11.18MB)数据库大量数据导出Excel","children":[{"title":"Sybase2Excel","children":[{"title":"bin","children":[{"title":"Sybase2Excel","children":[{"title":"sh","children":[{"title":"db","children":[{"title":"Utils.class <span style='color:#111;'>1.65KB</span>","children":null,"spread":false}],"spread":true},{"title":"Sybase2Excel.class <span style='color:#111;'>4.26KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'>629B</span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"Sybase2Excel","children":[{"title":"sh","children":[{"title":"db","children":[{"title":"Utils.java <span style='color:#111;'>1.17KB</span>","children":null,"spread":false}],"spread":true},{"title":"Sybase2Excel.java <span style='color:#111;'>3.54KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":".project <span style='color:#111;'>388B</span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'>813B</span>","children":null,"spread":false},{"title":"lib","children":[{"title":"dom4j-1.6.1.jar <span style='color:#111;'>306.54KB</span>","children":null,"spread":false},{"title":"poi-examples-3.9-20121203.jar <span style='color:#111;'>302.12KB</span>","children":null,"spread":false},{"title":"poi-ooxml-schemas-3.9-20121203.jar <span style='color:#111;'>4.58MB</span>","children":null,"spread":false},{"title":"poi-ooxml-3.9-20121203.jar <span style='color:#111;'>914.70KB</span>","children":null,"spread":false},{"title":"jconn2.jar <span style='color:#111;'>911.70KB</span>","children":null,"spread":false},{"title":"poi-excelant-3.9-20121203.jar <span style='color:#111;'>29.73KB</span>","children":null,"spread":false},{"title":"xmlbeans-2.3.0.jar <span style='color:#111;'>2.54MB</span>","children":null,"spread":false},{"title":"poi-3.9-20121203.jar <span style='color:#111;'>1.78MB</span>","children":null,"spread":false},{"title":"mysql-connector-java-5.1.21-bin.jar <span style='color:#111;'>808.54KB</span>","children":null,"spread":false},{"title":"poi-scratchpad-3.9-20121203.jar <span style='color:#111;'>1.17MB</span>","children":null,"spread":false},{"title":"jconn3.jar <span style='color:#111;'>445.97KB</span>","children":null,"spread":false},{"title":"stax-api-1.0.1.jar <span style='color:#111;'>25.89KB</span>","children":null,"spread":false}],"spread":false},{"title":"Resource","children":[{"title":"table.txt <span style='color:#111;'>3B</span>","children":null,"spread":false},{"title":"Data","children":[{"title":"bgk.xlsx <span style='color:#111;'>8.45KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • 墨雨森林:
    谢谢分享......2018-09-28
  • s287023202:
    按照提示自己都可以写一个了,谢了2015-01-30
  • tracine0513:
    很好,有启发2014-06-26
  • duankelin:
    很好,有启发2013-12-27

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明