-Java项目开发常见问题分析

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

JavaClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com�1�2�3�4Java�5ResourceOneClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com11�–Packagetest.demo.example–4ShipOrder.java–�Class�Static FinalStatic Final�()firstNamezipCodeClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2�collectioncollectionvectorcustomersclassmates–��–��Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com3–Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com4–CSS�CSSstama.css, industry.csscommerce.cssClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com5�–Package/ImportsClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com5–4TabTab–JAVA DOCJAVAClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com�1�2�3�4Java�5ResourceOneClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.1 Java1�2.1.1 Connection�ServletServlet�Connection conn= null;try {//} catch(SQLException) {e.printstacktrace();} finally {//finallyif(conn!=null){try{conn.close();}catch(SQLExceptione){e.printstacktrace();}}}Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.1 Java2–2.1.2 Statement/ResultSet�StatementSQLSQLException�Connection conn= null;Statement stmt = null;try {stmt = conn.createStatement();//} catch(SQLException) {e.printstacktrace();} finally {//finallyStatementif(stmt!=null){try{stmt.close();}catch(SQLExceptione){e.printstacktrace();}}if(conn!=null){try{conn.close();}catch(SQLExceptione){e.printstacktrace();}}}Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.1 Java3–2.1.3�try{conn= getConnection(com.icss.j2ee.util.Globals.DATASOURCEJNDI);TCCClientinterralsetDAO tCCClientinterralsetDAO =newTCCClientinterralsetDAO();tCCClientinterralsetDAO.setSerialnum(serialnum);tCCClientinterralsetDAO.setIntName(intName);tCCClientinterralsetDAO.setIntegral(Float.valueOf(integral));tCCClientinterralsetDAO.setNote(note);tCCClientinterralsetDAO.create();//TCCClientvalueinfoMonthDAOTCCClientvalueinfoMonthDAO tCCClientvalueinfoMonthDAO =newTCCClientvalueinfoMonthDAO();tCCClientvalueinfoMonthDAO.setClientCode(clientCode);tCCClientvalueinfoMonthDAO.setBursarMonth(bursarMonth);tCCClientvalueinfoMonthDAO.setHApprScore(hApprScore);tCCClientvalueinfoMonthDAO.setHApprGrade(hApprGrade);tCCClientvalueinfoMonthDAO.create();}catch(Exceptione){Debug.debug(e.getMessage(),e);}ConnnectionautoCommitfalsetrueConnectioncommit()Connectionrollback()Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.1 Java4–2.1.4�try{conn= getConnection(com.icss.j2ee.util.Globals.DATASOURCEJNDI);DAOFactoryfactory =newDAOFactory(conn);conn.setAutoCommit(false);String appuuid= request.getParameter(appuuid);String appname= request.getParameter(appname);String cnName= request.getParameter(cnName);String enName= request.getParameter(enName);String adminflag= request.getParameter(adminflag);String enabled =0;if(request.getParameter(enabled) !=null){enabled = request.getParameter(enabled);}String needRight=0;if(request.getParameter(needRight) !=null){needRight= request.getParameter(needRight);}String navUrl= request.getParameter(navUrl);String leftFrameEnabled= request.getParameter(leftFrameEnabled);String developer = request.getParameter(developer);Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.1 Java5String developer = request.getParameter(developer);String memo = request.getParameter(memo);String serialindex=0;if(request.getParameter(serialindex) !=null){serialindex= request.getParameter(serialindex);}String leftfirst= request.getParameter(leftfirst);String helpurl= request.getParameter(helpurl);String _page_num = ParamUtils.getParameter(request,_page_num);ModuleDAOmdao=newModuleDAO();mdao.setConnection(conn);mdao.setMuuid(newcom.icss.j2ee.util.UUID().toString());mdao.setCnname(cnName);mdao.setEnname(enName);DAOFactoryfactory = new DAOFactory(conn);Factory.setDAO(mdao);factory.find();......conn.commit();conn.setAutoCommit(false);conn.commit()Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.2 Java1�2.2.1 InputStream/OutputStream–�InputStream/OutputStreamFile.delete()–�InputStream/OutputStreamfinallyClick to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.2 Java2�2.2.2–(immutable)StringStringStringBuffer–�String s = new String (“Text here”);–�String temp= “Text here”; String s = new String (temp);String–�String s = Text here;Click to buy NOW!PDF­XCHANGE­track.comClick to buy NOW!PDF­XCHANGE­track.com2.2 Java3�2.2.3StringBuffer–StringStringBufferStringBufferStringStringStringBuffer–StringBufferStrin

1 / 39
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功