Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ѹËõÓë½âѹ

     ½üÀ´ÔÚ×öJAVAʱÓõ½ÎļþµÄѹËõÓë½âѹ,ÆäÖÐÅöµ½Á˸öÎÊÌâ:ÏÈÓÃJAVA´úÂë´ò°üºÃµÄJARÎļþ¾­¹ýC#µÄzlib´¦Àíºó,¾¹È»²»ÄÜÐÞ¸Ä!
     ÍøÉÏÕÒÁ˺ÃЩ´úÂ붼²»¿ÉÐÐ,JAVA´´½¨µÄJAR°üÔÚÐ޸ĵÄʱºò¿ÉÒÔ·¢ÏÖ¿ªÊ¼Óиö·¾¶·û'/'»ò'\',ËäÈ»ÔÚ´Ë¿ÉÒÔÐÞ¸ÄJARÎļþ,µ«ÊÇ×ܾõµÃÒþ»¼³öÔÚÕâ,ºóÀ´µÄÊÂÊ ......

java.lang.OutOfMemoryError: Java heap space

 
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖ ......

ÀûÓÃJava API¶Ô×Ö·û´®½øÐмÓÃܽâÃÜ£¨DES¼ÓÃÜËã·¨£©

 /*Decryptor*/
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
/**
 * Decrypt the password get form Xpress GUI
 */
public class Decryptor{
  
//¼ÓÃÜ    
  ......

JavaÊÂÎñAPI

 JavaÊÂÎñAPI£¨JTA£»Java Transaction API£©ºÍËüµÄͬ°ûJavaÊÂÎñ·þÎñ(JTS£»Java TransactionService)£¬ÎªJ2EEƽ̨ÌṩÁË·Ö²¼Ê½ÊÂÎñ·þÎñ¡£Ò»¸ö·Ö²¼Ê½ÊÂÎñ£¨distributedtransaction£©°üÀ¨Ò»¸öÊÂÎñ¹ÜÀíÆ÷£¨transaction manager£©ºÍÒ»¸ö»ò¶à¸ö×ÊÔ´¹ÜÀíÆ÷(resource manager)¡£Ò»¸ö×ÊÔ´¹ÜÀíÆ÷£¨resource manager£©ÊÇÈÎÒâÀàÐ͵ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ