Javaのバッチはデータを追加し、複数のフィールドが同時に追加されています。今日は、Javaの具体的な例を使用してデータを追加し、Oracleデータベースに面しています。
フロントデスクページ:
<span style = "font-size:14px;"> <body scroll = "no"> <div> <form name = "webform" method = "post"> <div> <div id = "baseinfo" onclick = " ActiveTabpaanel(1) "style =" margin-right:2px; ">基本情報</div> <div id =" semsinfo "onclick =" activeTabanel(2) "" ormarge-right:2px ";>パッケージ1 </ div> <div id = "changeinfo" onclick = "activeTabanel(3)" style = "marve-right:2px;"> pack 2 </div> <div id = "familyinfo" onclick = "activeTabanel(4)"スタイル= "マージンライト:2px;">ページ3 </div> <div id = "changeinfo" onclick = "activeTabanel(5)" style = "margin-right:2px;"> page 4 </div> <div id = "familyInfo" onclick = "activeTabanel(6)" style = "margin-right:2px;"> pack 5 </div> <div id = "familyinfo" onclick = "activeTabanel(7)" style = "マージン - 右:2px; "> page 6 </div> </div> <div> <bankcarddiv"> <div> <div> "new Line" onclick = "addnewrow();" /> < /div> <div> <table id = '100%' border = '0' cellspacing = '1' cellpadding = '0'クラス= 'content_list'> <tr> <th class = 'content_table_number'>シリアル番号</th> <th> le_thnowarp '>プロパティ1 </th> <th class =' content_table_thnowarp '>プロパティ2 </ th> <class = 'content_table_thnowarp'>プロパティ3 </th> <th class = 'content_table_thnowarp'> </this <th> <th> <th> <th> <th class = 'content_table_thnowarp'>プロパティ5 << /th> <class = 'content_table_thnowarp'>プロパティ6 </th> <th class = 'content_table_thnowarp'>プロパティ7 </th> <th> <content_table_thnowarp '> <th class =' content_table_thnowarp '>プロパティ9 </th> <th class = 'content_table_thnowarp'>操作</th> </tr> <c:if test = "$ {fngth(personfamilyinfolist)> 0}"> <c:foreach item = "$ {{$ { personfamilyInfolist} "var =" personfamilyinfolist "varstatus =" st "> <! - > <td> $ {st.count} <入力タイプ=" hidden "natural =" personfamilyinfolist [$ {s.count-1}]。 sguid "value =" $ {personfamilyinfolist.sguid} "/> <入力型=" personfamilyinfolist [$ {st.count-}] "personfamilyinfolist.spersonguid}"/> type = "hidden" name = "personfamilyInfolist [$ {st.count-1}]。sunitguid" = "$ {person familyinfolist.sunitguid}"> <入力タイプ= "hidden" name = "personfamilyinfolist [$ {s.count -1}]。 = "personfamilyInfolist [$ {st.count-1}]。sfamlyname" maxlength = "20" = "$ {porson familyinfolist.sfamilyname}" >> </td> <! - 属性2-> <td> <入力ID = "sfamilyidcadno $ {st.count-}" type = "text" name = "personfamilyInfolist [$ {st.count-}] .sfamilyidcardno" maxlength = "value =" $ {personfamilyinfolist.sfamilyidcardno} " td> <! - 属性3-> <select id = "ifamilysex $ {st.c {st.c out-1}" name = "personfamilyinfolist [$ {s.count-1}]。 <ZW:BeadictList ItemCode = "<%= Constants.i_Person_Sex%> onfamilyInfolist.ifamilySex}"> </zw:beadictlist> </select> <font color = "red">*</font> </td> <! -ATTRIBUTE 4-> <SELECT ID = "SFAMILYRELATION $ {St.Count-}" name = "personfamilyInfolist [$ {St.Count-1}]。sfamilyRelelelelation> <ZW:basedictlist itemcode =" <%= constants.s_oldily%relation% > ersonfamilyInfolist.sfamilyRelation} "> </zw:bedingictlist> </select> <font color =" red ">*</font> </td> <! - プロパティ5-> <入力id =" "text" name = "personfamilyInfolist [$ {st.count-1}]。sfamilyinsuranceplace" maxlength = "20" lace} "> </td> <! - 属性6-> <td class = 'content_table_td_centernowrap'> <入力id = "sfamilyresidencerce $ {St.Count-}" Type = "Text" Natural St.Count-1}]。 SfamilyPhone $ {St.Count 1} ersonfamilyInfolist [$ {St.Count-1}]。入力ID = "ddentifysucessdate $ {st.count 1}" type = "text" name = "personfamilyInfolist [$ {s.count-1}]。 vdisp = "最初の保険時間" size = "18" maxlength = "18"/> <font color = "red">*</font> </td> <! - 属性9-> <td> <入力ID = "ddentifyLostdate $ {st.count - }" type = "text" name = "personfamilyInfolist [$ {st.count -1}]。 「最初の保険時間」サイズ= "18" maxlength = "18"/> </td> <td class = 'content_table_centernowrap'>キャンセル</td> </tr> </c:foreach> </c:if> </table> </div> </div> </div> <div> <div> <table> <tr> <td align = "center"> <input id = "btnnextStep" type = "ボタン"値= "onclight =" " /> <input id =" btnadd "type =" button "value =" onclick = "saverupdate)" / /> <input id = "" type = "button" value = "complet" onclick = "/> <input id =" btnreturn "type =" button "value =" return "onclick =" "/> </td> </tr> </table> </div> </div> </ form> </div> </body> </span>
JavaScript関数:
<span style = "font-family:kaiti_gb2312; font-size:14px;"> <script type = "text/javascript"> $(function(){loadcheck()); #parttable tr ') 2。 > '+' <td> '+row+' </td> '+' << td> '+' <入力id = "sfamilyname '+num+'" name = "personfamilyinfolist ['+num+'] "maxlength =" 20 "> </td> '+' <td> '+' <input id =" sfamilyidno '+num+' "type =" text "infolist ['+num+'] .sfamilyidcardno" maxlength = "20 20 20 "> </td> '+' << td> '+' <select id =" ifamilysex '+num+' "namefamilyInfolist ifamilysex"> '+' <zw:badedictlist itemcode = "2000" selectvalue = "personfamilyInfolistist ['+num+']。 sfamilyRelation '+num+' "name =" personfamilyinfolist ['+num+']。 <font color = "red">*</font> </td> '+'+'<td>'+'<input id = "sfamilyinsurancepleplaceplace'+'" type = "text" name = "personfamilyinfolist ['+num++ '] = "20"> </td>'+'<< td>'+'<input id = "sfamilyresidencence'+num+'" type = "name =" personfamilyinfolist ['+num+']。 = "20"> </td> '+' <td> '+' <input id = "sfamilyphone '+num+'" type = "text" name = "personfamilyInfolist ['+num+']。sfamilyphone" maxlength = " 20 "> </td> ''+'<入力id =" ddentifysucessdate'+num+'"type =" text "name =" personfamilyinfolist ['+num+'] "size =" 18 "maxlength =" 18 "/> <font color =" red ">*</font> </td> ' +' << td> ' +' <入力id =" ddentifyLostdate ' +num + '"type =" text "name =" personfamilyinfolist ['+num+'] onfocus = "wdatepicker()" notnull = "true" vdisp = "size =" "=" 18 "/> </td> ' +' <td> ' +' <onclick = "delinsuranceinfo(this);"> cancel </a> ' +' </td> ' +' </tr> '; append(htmltext); num + 1;} // delete delinsuranceinfo {if(row> 0){row = row-1} t).Parent() (document。forms[0])成功した保存 "function(){});} else if(resobj.trim()== 'update'){ext.messagebox.alert(" prompt "、" update "、function(){}); messagebox。 alert( "Tips"、 "Save Fail");}});} </span> <Span style = "font-family:Kaiti_gb2312; font-size:14px;"> </script> </</</</</</</</</</</</</</<スパン>
背景を追加する方法:
<span style = "font-family:kaiti_gb2312; font-size:14px;">/*** <p>説明:バッチに複数の情報を追加</p>* @param personfamilyinfolistエンティティリスト* @return boolean、それ以外の場合、それは追加されます。 i ++){String personfamilyid = u uidhexgenrator.getuid(); )。 i)setDopictate(new Date())); ).SETDDDENFYLOSTDATE(null); try {string sguidstring = personfamilyInfoserv ice.saveneedpk(personfamilyInfolist.get(i)。toString(); if(!!! "" quatals(sguidstring)&&sguidstring.length(){){ bool = true;} else {system.out.println( "相対情報フォームのサポート"+i+"バー情報ストレージは失敗しました! "); bool = false; return bool;}} catch(exception e){e.printstacktrace();}}} return bool;} </span>
バックグラウンド更新方法:
<span style = "font-family:kaiti_gb2312; font-size:14px;">/*** <p>説明:バッチアップデート情報</p>* @param personfamilyInfolist id staff id* @return boolean、trueは更新、それ以外の場合は更新が失敗します * @throws例外 * @author:gaoying * @update: * @date:2015-7-20 */ public void(list <personfa milyinfo> personfa milyinfolist、string personid)スロー例データはありますか? ; i <num; if(!oldPersonFamilyInFolist。get(i).getsfamilyidcardno()。 ).GETIFAMILYSEX()。 = false;} if(!! oldpersonfamilyinfolist.get(i).getsfamilyinsuranceplace()。 )。 「時間を変更する前:+oldPersonFamilyInfolist.get.get(i).getDDENTIFYSUCESSDATE()。getTime()); ist.get(i)。getDentifysucesssdate()。getTime()); .getDDENTIFYSUCESSDATE()!それは変更されず、データベースの現在の時間をデータの故障時間に設定します。 「データの主要な鍵: " + personfamilyinfo.setsguid(uuidhexgenrator.getuid()); .setDoperatedate(1);システムの時間(null); personfamilyinfoservice.merge(personfamilyinfolist.get(i));}} catch(expert e){e.printstacktrace();}} </span>
このように、Javaのマルチフィールドと複数のデータバッチの例は、フロントデスクページに重ね合わせるためにそれを使用して、追加および更新方法に注意を払う必要があります、サイクルトラバーサルが追加されます。さらに、次のコードについてお話したいと思います。
コードコードを次のようにコピーします。<span style = "font-family:kaiti_gb2312; font-size:14px;"> $(function(){
loadCheck();
});
これは、次のコードの略語です。
コードコードを次のようにコピーします。
loadCheck();
});
実際、このコードと次のコードは次のことを意味します。
コードコードを次のようにコピーします。<span style = "font-family:kaiti_gb2312; font-size:14px;"> window.onload = function(){{{{{
loadCheck();
} </span>
このようにして、オンラインオンロードイベントに電話する必要はありません。JSプログラムセグメントに書くだけです。次のコードは上記の2つと交換できますが、それらは異なります。 1つ目は、実行時間が異なることです(Docume)。明らかに、前者の実行効率は後者よりも高くなっています。次に、$ readyが繰り返される可能性があります。
上記は、この記事のすべての内容です。