´«ÖDz¥¿Íjavaѧϰ jdbc½ø½×
1.PreparedStatementÓëstatement±È½Ï
*°²È«ÐÔ£ºPreparedStatement°²È«£¬statement²»°²È«
*ÅúÁ¿Óï¾äµÄÖ´ÐУºPreparedStatementÖ´ÐÐЧÂʸߣ¬statementÖ´ÐÐЧÂʵͣ¬
*µ¥ÌõÓï¾äµÄÖ´ÐУºPreparedStatementÖ´ÐÐЧÂʵͣ¬statementÖ´ÐÐЧÂʸߣ¬
**********************************
´úÂëµÄ¿É¶ÁÐԺͿÉά»¤ÐÔ.
PreparedStatement ÄÜ×î´ó¿ÉÄÜÌá¸ßÐÔÄÜ£º
DBServer»á¶ÔÔ¤±àÒëÓï¾äÌṩÐÔÄÜÓÅ»¯¡£ÒòΪԤ±àÒëÓï¾äÓпÉÄܱ»Öظ´µ÷Óã¬ËùÒÔÓï¾äÔÚ±»DBServerµÄ±àÒëÆ÷±àÒëºóµÄÖ´ÐдúÂë±»»º´æÏÂÀ´£¬ÄÇôÏ´ε÷ÓÃʱֻҪÊÇÏàͬµÄÔ¤±àÒëÓï¾ä¾Í²»ÐèÒª±àÒ룬ֻҪ½«²ÎÊýÖ±½Ó´«Èë±àÒë¹ýµÄÓï¾äÖ´ÐдúÂëÖоͻáµÃµ½Ö´ÐС£
ÔÚstatementÓï¾äÖÐ,¼´Ê¹ÊÇÏàͬ²Ù×÷µ«ÒòΪÊý¾ÝÄÚÈݲ»Ò»Ñù,ËùÒÔÕû¸öÓï¾ä±¾Éí²»ÄÜÆ¥Åä,ûÓлº´æÓï¾äµÄÒâÒå.ÊÂʵÊÇûÓÐÊý¾Ý¿â»á¶ÔÆÕͨÓï¾ä±àÒëºóµÄÖ´ÐдúÂ뻺´æ.ÕâÑùÿִÐÐÒ»´Î¶¼Òª¶Ô´«ÈëµÄÓï¾ä±àÒëÒ»´Î.
PreparedStatementÄܱ£Ö¤°²È«ÐÔ
2.ÀûÓÃforÑ»·¿ÉÒÔÍùÊý¾Ý¿â²åÈë¶àÌõ¼Ç¼£¬
long begintime=system.currentTimemillis();//¿ªÊ¼Ê±¼ä
¿ÉÒԼǼ²åÈë¶àÌõ¼Ç¼ËùÓõÄʱ¼ä£»
3.ÍùOracleÊý¾Ý¿â²åÈë¶àÌõ¼Ç¼£¬PreparedStatementÒª±ÈstatementµÄËٶȿ졣
PreparedStatementÏȽ«sqlÓï¾äÔ¤±àÒëºÃ£¬ÔÙ²åÈëÊý¾Ý¿â
¶østatementÿ´Î¶¼ÒªÖ´ÐбàÒësqlÓï¾ä
4.ÓÃPreparedStatement²åÈë5000Ìõ¼Ç¼£¬oracleÓÃʱ3Ã룬mysqlÓÃʱ109Ã룬
5.µ÷ÓÃÊý¾Ý¿âÖеÄStore Procedure£¨´æ´¢¹ý³Ì£©Ê±,ÒªÓõ½Callable Statement
************
×÷Òµ£º
1. EL±í´ïʽ»ñÈ¡Õæʵ·¾¶£º${pageContext.request.contextPath}
jspµÄrequest¶ÔÏó»ñÈ¡Õæʱ·¾¶<%=request.getrealpath() %>
2.תÏò£ºservlet£º´Óµ±Ç°Â·¾¶¿ªÊ¼²éÕÒ£¬
jspÒ³Ã棺´ÓÓ¦ÓóÌÐò¸ù·¾¶¿ªÊ¼ÕÒ£¬
3.´¦ÀíÈÕÆÚ£º
java.sql.Date birthday=java.sql.Date.valueof(sbirthday.trim());
4. <c:choose>
<c:when test="${!empty list}">
</c:when>
<c:otherwise>
ûÓÐÄúÒª²éѯµÄÊý¾ÝÔ´
</c:otherwise>
&nbs
Ïà¹ØÎĵµ£º
½ñÌìÎÒѧϰÁËsqlµÄ¼òµ¥²éѯÓï¾ä£¬
һЩ»ù±¾µÄ¸ÅÄ
1 ϵͳȨÏÞ£ºÊý¾Ý¿âÖеĶÔÏó£¬ ±í£¬´´½¨±í£¬É¾³ý±í
2 ¶ÔÏóȨÏÞ£º¶ÔÊý¾ÝµÄÔö¡¢É¾¡¢¸Ä¡¢²é¡ ......
package com.gis.biz;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.servlet.http. ......
ÐÅÏ¢À´Ô´£ºÐ°¶ñ°Ë½øÖÆÐÅÏ¢°²È«ÍŶӣ¨www.eviloctal.com£©
Author:kj021320
תÔØÇë×¢Ãû³ö´¦¡£
JavaÓ¦ÓóÌÐò»·¾³µÄ°²È«²ßÂÔ£¬Ïêϸ˵Ã÷Á˶ÔÓÚ²»Í¬µÄ´úÂëËùÓµÓеIJ»Í¬×ÊÔ´µÄÐí¿É£¬ËüÓÉÒ»¸öPolicy¶ÔÏóÀ´±í´ï¡£
ΪÁËÈÃapplet£¨»òÕßÔËÐÐÔÚSecurityManagerϵÄÒ»¸öÓ¦ÓóÌÐò£©Äܹ»Ö´ÐÐÊܱ£»¤µÄÐÐΪ£¬ÀýÈç¶ÁдÎļþ£¬applet£¨»òJav ......
ÎÒ½ñÌìѧϰÁËÓÃjdbcÁ¬½ÓÊý¾Ý¿âµÄ֪ʶ£¬ÎÒ×öÁ˼òµ¥µÄ±Ê¼Ç£º
1.Êý¾Ý¿âµÄurl jdbc:mysql://loaclhost:3306/test
jdbc:±íʾÁ¬½ÓÊý¾Ý¿âʹÓõÄÊÇjdbcÐÒé
mysql£º±íʾÁ¬½ÓÊý¾Ý¿âµÄ×ÓÐÒ飬²»Í¬µÄÊý¾Ý¿âʹÓõÄÐÒé²» Ò»Ñù
localhost£ºÊý¾Ý¿â·þÎñÆ÷ËùÔÚµÄipµØÖ·
3306 £ºÊ¹ÓõĶ˿ںÅ
tes ......