Java°æ½«EXCEL±íÊý¾Ýµ¼Èëµ½Êý¾Ý¿âÖÐ
¿ÉÄܺܶ࿪·¢Õß»áÃæ¶Ô¿Í»§ÕâÑùµÄÐèÇó£¬ÔÚδʹÓÃϵͳ֮ǰ£¬ËûÃǺܶàÊý¾Ý¶¼ÊDZ£´æÔÚWord»òÕßExcelµÈһЩµç×Ó±í¸ñÖУ¬ÏÖÔÚËûÃÇÐèÒª½«ÔÀ´µÄÊý¾Ý×Ô¶¯µ¼È뵽ϵͳÖÐÈ¥£¬¶ø²»ÊÇÒ»ÌõÒ»ÌõµØÊÖ¹¤Â¼Èë¡£ÎÒ¾ÍÅöµ½ÁËÕâÑùµÄÐèÇ󣬾¹ýÒ»·¬ÕÛÌÚÖ®ºó£¬ÖÕÓÚʵÏÖÁË£¬ÎÒÊDzÉÓõÚÈý·½¿Ø¼þJXLʵÏֵģ¬ÔÀíÊDZȽϼòµ¥µÄ¡£ÏÂÃæÊÇÏêϸµÄ´úÂ룺
try
{
//ʵÀý»¯Ò»¸ö¹¤×÷²¾¶ÔÏó
Workbook workBook=Workbook.getWorkbook(new File("F:\\qzlx.xls"));
//»ñÈ¡¸Ã¹¤×÷±íÖеĵÚÒ»¸ö¹¤×÷±í
Sheet sheet=workBook.getSheet(0);
//»ñÈ¡¸Ã¹¤×÷±íµÄÐÐÊý£¬ÒÔ¹©ÏÂÃæÑ»·Ê¹ÓÃ
int rowSize=sheet.getRows();
for(int i=0;i<rowSize;i++)
{
//񅧏
String id=sheet.getCell(0,i).getContents();
//תÀ´µ¥Î»¼°ÎĺÅ
String turn_unit=sheet.getCell(1,i).getContents();
//À´ÐÅÈËÐÕÃû
String reg_name=sheet.getCell(2,i).getContents();
//À´ÐÅÈ˵¥Î»»òסַ
String reg_unit=sheet.getCell(3,i).getContents();
//À´ÐÅÄÚÈÝ
String reg_content=sheet.getCell(4,i).getContents();
//À´ÐÅÈÕÆÚ
Date reg_time = java.sql.Date.valueOf(sheet.getCell(5,i).getContents());
//ÐÅ·ÃÊÂÏî·¢ÉúµØ»òµ¥Î»
String reg_eventUnit=sheet.getCell(6,i).getContents();
//´¦ÀíÇé¿ö
String do_case=sheet.getCell(7,i).getContents();
//´¦ÀíÈÕÆÚ
Date do_time=java.sql.Date.valueOf(sheet.getCell(8,i).getContents());
//ÎÊÌâ¹éÀà
String problem_type=sheet.getCell(9,i).getContents();
//ÎÊÌâËùÊôϵͳ
String problem_system=sheet.getCell(10,i).getContents();
//¶½°ìʱ¼ä¼°ÎĺÅ
String wenhao=sheet.getCell(11,i).getContents();
//¾°ìÈË
String processor=sheet.getCell(12,i).getContents();
//±¸×¢
String remark=sheet.getCell(13,i).getContents();
LcTOldRegServiceImpl regService=new LcTOldRegServiceImpl();
LctOldReg reg=new LctOldReg(id,turn_unit,reg_name,reg_unit,reg_time,do_time,wenhao,problem_system,problem_type,reg_eventUnit,remark,reg_content,processor,do_case);
//Ö´
Ïà¹ØÎĵµ£º
MonoRailÊǾµäµÄMVCģʽ,ËùÒÔÆäÖÐÒ²¾ßÓÐÈý¸öÔªËØModel,Controller,View,ÆäÖÐMonoRailÊÇͨ¹ýUrlµØÖ·À´½âÎö
ÏàÓ¦µÄ²Ù×÷µÄ,Èçµ±Äã·ÃÎÊ:/home/index.rail,¶ÔÓ¦»áÖ´ÐÐHomeControllerÀàÖеÄIndex·½·¨,¶øÇÒ¿ÉÒÔ×Ô¶¯°ó¶¨²ÎÊýºÍ
RequestµÄÊý¾Ý,Èç·ÃÎÊ:/home/index.rail?id=1,Äã¿ÉÒÔÔÚHomeControllerÀàÖеÄIndex·½·¨Öж¨ÒåÒ»¸ö²ÎÊý ......
µÚÒ»²¿·Ö. Ìáʾ
ÎÒÐèÒª¶ÁÕâƪÎÄÕÂÂð£¿
JavaÀà¼ÓÔØÆ÷¶ÔJavaϵͳµÄÔËÐÐÊÇÖÁ¹ØÖØÒªµÄ£¬µ«ÊÇÈ´³£³£±»ÎÒÃǺöÂÔ¡£JavaÀà¼ÓÔØÆ÷¸ºÔØ
ÔÚÔËÐÐʱ²éÕҺͼÓÔØÀà¡£×Ô¶¨ÒåÀà¼ÓÔØÆ÷¿ÉÒÔÍêÈ«¸Ä±äÀàµÄ¼ÓÔØ·½Ê½£¬ÒÔ×Ô¼ºÏ²»¶µÄ·½Ê½À´
¸öÐÔ»¯ÄãµÄJavaÐéÄâ»ú¡£±¾ÎļòÒªµÄ½éÉÜJavaÀà¼ÓÔØÆ÷£¬È»ºóͨ¹ýÒ»¸ö¹¹Ôì×Ô¶¨ÒåÀà¼ÓÔØÆ÷
µÄÀý×ÓÀ´ËµÃ÷£¬Õâ ......
JavaºÍÆäËûÓïÑÔ²»Í¬µÄÊÇ£¬JavaÊÇÔËÐÐÓÚJavaÐéÄâ»ú(JVM)¡£Õâ¾ÍÒâζ×űàÒëºóµÄ´úÂëÊÇÒÔ
Ò»ÖÖºÍƽ̨Î޹صĸñʽ±£´æµÄ£¬¶ø²»ÊÇijÖÖÌض¨µÄ»úÆ÷ÉÏÔËÐеĸñʽ¡£ÕâÖÖ¸ñʽºÍ´«Í³µÄ¿É
Ö´ÐдúÂë¸ñʽÓкܶàÖØÒªµÄÇø±ð¡£¾ßÌåÀ´Ëµ£¬²»Í¬ÓÚC»òÕߣÃ++³ÌÐò£¬Java³ÌÐò²»ÊÇÒ»¸ö¶À
Á¢µÄ¿ÉÖ´ÐÐÎļ ......
Cookie£º¼Ç¼Óû§µÇ½״̬£¬¿ÉÒÔÔÚ¿Í»§¶Ë´´½¨cookie£¬¿ÉÒÔʹÓû§µÚ¶þ´ÎµÇ½µÄʱºò²»ÓÃÊäÈëÓû§ÃûºÍÃÜÂ룬¼´¿ÉÒԵǽµ½Ö÷Ò³
Ö÷Òª´úÂ룺
LoginView ÖУº £¨»ñÈ¡cookie£©
//»ñÈ¡cookie
Cookie [] cs=request.getCookies();
String name="";
String value="";
if(null!=cs)
......
Ò» ²åÈëÅÅÐò·¨:
˵Ã÷: ÿ´Î½«Ò»¸ö´ýÅÅÐòµÄ¼Ç¼£¬°´Æä¹Ø¼ü×Ö´óС²åÈ뵽ǰÃæÒѾÅźÃÐòµÄ×ÓÎļþÖеÄÊʵ±Î»Öã¬Ö±µ½È«²¿¼Ç¼²åÈëÍê³ÉΪֹ¡£ Java´úÂë public class InsertSorter extends Sorter { /** * from ÆðʼλÖà ......