Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ͨ¹ýibatisµÄblob ´æ´¢javaµÄhashmap

 Õ⼸Ìì²âÊÔblob»ñÈ¡ºÍ´æ´¢µÄʱºò,±»¿¨Á˺ܾÃ,×îºó²Å·¢ÏÖÊÇÕ¼ÓÃÁ˹ؼü×Öµ¼ÖÂÎÞ·¨»ñÈ¡½á¹û,ѪµÄ½Ìѵ°¡.
ÒÔºóÆðÃû×ÖÒªÓÃ×î¶ñÐĵÄ,²»ÒªÓÃ×î·½±ãµÄÁË.Ïл°ÉÙ˵,javaµÄhashmapÊDz»ÄÜÖ±½Ó´æ´¢µ½Êý¾Ý¿âÖеÄ.
±¾µØÊý¾Ý¿âΪmysql,ÀïÃæÓÐblobµÄÀàÐͿɹ©Ê¹ÓÃ.·½·¨Ò²ºÜ¼òµ¥,ÉÏ´úÂë
Êý¾Ý¿â½¨±í
CREATE TABLE `test` (
`id` varchar(32) NOT NULL,
`fieldarr` blob,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

JavaÀà
public class Test implements Serializable{
private String id;
private byte[] fields;
public String getId(){
return id;
}
public void setId(String id){
this.id = id;
}
public byte[] getFields(){
return fields;
}
public void setFields(byte[] fields){
this.fields = fields;
}
}

È»ºóÅäÖÃibatis
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="Test">
<!-- Use type aliases to avoid typing the full classname every time. -->
<typeAlias alias="Test" type="bruce.Test"/>
<resultMap id="FieldResult" class="Test">
<result property="id" column="ID"/>
<result property="fields" column="FIELDARR" jdbcType="BLOB" />
</resultMap>
<select id="selectTestByid" parameterClass="string" resultMap="FieldResult">
<!--[CDATA[
select * from test
where ID = #value#
]]>
</select>
<update id="updateTest" parameterClass="Test">
<![CDATA[
update test set
FIELDARR = #fields#
where
ID = #id#
]]-->
</update>

</sqlMap>

daoÕý³£Ð´¾Í¿ÉÒÔ
public List<Test> selectTestByid(String id) throws SQLException {


Ïà¹ØÎĵµ£º

JavaÖÐstatic¡¢this¡¢super¡¢final µÄÓ÷¨

 ±¾ÆªÖ¼ÔÚ°ïÖú×¼±¸Ñ§Ï°JavaÒÔ¼°¸Õ½Ó´¥JavaµÄÅóÓÑÈÏʶ¡¢ÕÆÎÕºÍʹÓÃstatic¡¢this¡¢super¡¢finalÕ⼸¸ö¹Ø¼ü×ÖµÄʹÓá£Java²©´ó¾«ÉÎÒÒ²ÊÇһλÕýÔÚѧϰºÍʹÓÃJavaµÄ°®ºÃÕߣ¬ÎÄÖÐÄÑÃâÓв»Í×Ö®´¦£¬»¶Ó­Ö¸Õý¡£
Ò»¡¢static
¡¡ÇëÏÈ¿´ÏÂÃæÕâ¶Î³ÌÐò£º
public class Hello{
  public static void main(String[] args){ ......

java ʼþ»úÖÆ̽ÌÖ

javaÖеÄʼþ»úÖƵIJÎÓëÕßÓÐ3ÖÖ½ÇÉ«£º
1.event object£º¾ÍÊÇʼþ²úÉúʱ¾ßÌåµÄ“ʼþ”£¬ÓÃÓÚlistenerµÄÏàÓ¦µÄ·½·¨Ö®ÖУ¬×÷Ϊ²ÎÊý£¬Ò»°ã´æÔÚÓëlisternerµÄ·½·¨Ö®ÖÐ
2.event source£º¾ßÌåµÄ½ÓÊÜʼþµÄʵÌ壬±ÈÈç˵£¬Äãµã»÷Ò»¸öbutton£¬ÄÇôbutton¾ÍÊÇevent source£¬ÕâÑùÄã±ØÐëʹbutton¶ÔijЩʼþ½øÐÐÏàÓ¦£¬Äã¾ÍÐè ......

Java Àà×°ÈëÆ÷Ô­Àí

 
תÔØ×Ôhttp://blog.csdn.net/yuekun1172006/archive/2007/06/02/1634878.aspx
Àà×°ÈëÆ÷ÊÇ JVM ÓÃÀ´×°ÈëÀàµÄÀ࣬Ëü¶ÔÓÚ Java ±à³ÌÊǷdz£ÖØÒªµÄÒ»¸ö¸ÅÄî¡£Ò»°ãÇé¿öÏ£¬³ÌÐòÔ±ÔÚ±àд³ÌÐòµÄʱºò¶¼¿ÉÒÔºöÂÔÀà×°ÈëÆ÷µÄ´æÔÚÐÔ¡£µ«ÊǶÔÓÚ·þÎñÆ÷¶Ë±à³Ì»òÕßÊÇһЩÌØÊâÇé¿öÏÂʱºò£¬ÉîÈëÁ˽âÀà×°ÈëÆ÷µÄ»úÖÆÒÔ¼°ÆäÔÚ²»Í¬Çé¿öϵ ......

2Äêjava¹ºÎï³µ·ÖÎö

Ò».µã»÷ͼÊ飬չʾ¸ÃÊéµÄÏêϸÐÅÏ¢
 µã»÷ͼÊé→booksÒ³Ãæ→ͨ¹ýurlÖØдdisplayBook.jsp?isbn=¸ÃÊé±àºÅ →´«ÈëdisplayBooksÒ³Ãæ→
<c:set var="isbn" value="${param.isbn}"></c:set>
<c:forEach var="currentBook" items="${sessionScope.bookTitles}">
 <c:if test="${ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ