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

JavaʵÏÖCSVÎļþ²îÒì¶Ô±È

ÔÚÏîÄ¿Öо­³£»áÓöµ½Ê¹ÓÃCSVÎļþ£¬±ÈÈç´ÓHRÖеõ½µÄÎļþÄõ½ÆäËüµØ·½È¥´¦Àí£¬Êµ¼Ê»áÐèÒªµÃµ½µ±Ç°ºÍÉÏ´ÎÎļþÖеIJîÒ죬±ÈÈ磺Ìí¼Ó£¬É¾³ý£¬Ð޸ģ¬ ÄÇôÈçºÎÀ´ÊµÏÖÄØ£¬¿ÉÄÜÓкܵķ½·¨£¬ÔÚÕâÀïÎÒ˵һÏÂÎÒµÄʵÏÖ·½·¨¶øÇÒÒÑͶÈëʵ¼ÊʹÓá£
Ê×ÏÈ£¬ CSVÎļþµäÐÍÒÔ,·Ö¸ô£¬µ±È»»¹ÓÐÆäËüµÄ×Ö·û£¬ÓɺܶàÁеÄÊôÐÔºÍÊôÐÔÖµ×é³É£¬ÄÇôÁ½¸öÎļþ±ä»¯Ö®ºó£¬Í¨³£»áÊÇÔõÑùµÄÇé¿öÄØ£¬
±ÈÈ磺ÌíеÄÒ»ÐУ¬É¾³ýÒÑÓÐÒ»ÐУ¬ÐÞ¸ÄÒÑÓÐÐÐijЩֵ£¬Ã»ÓÐÈκα仯¡£
ËùÒÔʵÏÖ˼·ÊÇ£º ¹Ø¼üÖ®Ò»ÊÇÄܹ»ÕÒÒ»¸ö¶«Î÷À´Î¨Ò»±êʶÿһÐУ¬ÔÚÕâÀïÎÒÓõİÑij¼¸¸ö×Ö¶Î×éºÏÀ´×÷ΪID,ÓÐÁËÕâ¸öºó¾ÍºÃ°ì·¨£¬¶ÁÈ¡Á½¸öÎļþ²¢°ÑID¼ÆËã³öÀ´£¬µ«»¹ÓÐÒ»¸öÊÂÇé¾ÍÊÇÎļþ¶¼¶Á½øÀ´ÁË£¬Ó¦¸ÃÈçºÎÀ´¾ö¶¨Ìí¼Ó£¬É¾³ý£¬ÐÞ¸ÄÄØ£¬Ç°ÃæËµÁ˼ÈÈ»ÓÐÁËID£¬ÄÇôÄÃÈ¥±È½Ï£º
ID in old not in new   - > delete
ID in new not in old -> add
ID in both old and new -> modify
example:
old:
value1,value2,value3
test1,test2,test3
new:
hello,world,haha
value1,value2,value4
delta:
A, hello,world,haha
M, value1,value2,value4
D, test1,test2,test3
ÔÚÐÞ¸ÄÇé¿öÏ»¹ÒªÈ¥ÅжÏÐÞ¸ÄÁËÄÄЩֵ¡£Ê¹ÓÃJavaµÄÇé¿öÏ£¬ÎÒµÄ×ö·¨ÊǶÁÈ¡Á½¸öÎļþÈ»ºó·âװΪEntry, ÔÙ°Ñentry´æÈëMap£¨ID£¬ Entry£©ÖÐ,È»ºóÔÙ×ö±È½Ï£¬´Ó×óµ½ÓÒ¾ö¶¨Ìí¼ÓºÍÐ޸쬴ÓÓÒµ½×ó¾ö¶¨É¾³ý£¬Ê¹ÓÃMapµÄkey,value²éÕÒÌØÐÔ£¬µ±È»Á˱ȽϽáÊøºóÒª°ÑDeltaÊý¾Ýдµ½ÐµÄcsvÎļþÖÐ,Ŀǰ´¦Àí8000ÐÐ×óÓÒµÄʱ¼äÔ¶ÔÚ1sÄÚ¡£ÏÂÃæÊDZȽϵĴúÂëÆ¬¶Ï
/**
* Compare the two Map then return the delta entry list
* @param input Map input Map where stored the entry and ID
* @param previous Map previous Map
*/
public List<Entry> deltaEntryList(Map<Object, Object> input, Map<Object, Object> previous){
List<Entry> deltaList = new ArrayList<Entry>();
Iterator iterInput = input.entrySet().iterator();
Util.log("debug", "Compare input with previous");
while (iterInput.hasNext()) {
Map.Entry entry = (Map.Entry) iterInput.next();
Object keyInput = entry.getKey();
Object valInput = entry.getValue();
//For Add
if( !previous.containsKey(keyInput) ){
Entry deltaAdd = (Entry)valI


Ïà¹ØÎĵµ£º

Java¶ÔÏóµÄÐòÁл¯ºÍ·´ÐòÁл¯

µ±Á½¸ö½ø³ÌÔÚ½øÐÐÔ¶³ÌͨÐÅʱ£¬±Ë´Ë¿ÉÒÔ·¢Ë͸÷ÖÖÀàÐ͵ÄÊý¾Ý¡£ÎÞÂÛÊǺÎÖÖÀàÐ͵ÄÊý¾Ý£¬¶¼»áÒÔ¶þ½øÖÆÐòÁеÄÐÎʽÔÚÍøÂçÉÏ´«ËÍ¡£·¢ËÍ·½ÐèÒª°ÑÕâ¸öJava¶ÔÏóת»»Îª×Ö½ÚÐòÁУ¬²ÅÄÜÔÚÍøÂçÉÏ´«ËÍ£»½ÓÊÕ·½ÔòÐèÒª°Ñ×Ö½ÚÐòÁÐÔÙ»Ö¸´ÎªJava¶ÔÏó¡£
¡¡¡¡°ÑJava¶ÔÏóת»»Îª×Ö½ÚÐòÁеĹý³Ì³ÆÎª¶ÔÏóµÄÐòÁл¯¡£
¡¡¡¡°Ñ×Ö½ÚÐòÁлָ´ÎªJava¶ÔÏóµÄ¹ ......

javaÐÔÄÜ¼à¿Ø¹¤¾ß btrace

btraceÊÇsunÍÆ³öµÄÒ»¿îjavaÐÔÄÜ¼à¿Ø¹¤¾ß£¬ÀûÓÃjava agent ºÍ jvm attach¼¼Êõ£¬¿ÉÒÔ²»Í£»úµÄÇé¿öÏÂ¼à¿ØÏßÉÏÇé¿ö£¬²¢ÇÒ×öµ½×îÉÙµÄÇÖÈ룬ռÓÃ×îÉÙµÄϵͳ×ÊÔ´¡£
Ïêϸ¼û¹Ù·½Îĵµ
ÁíÍâbtraceÓкÜÑϸñµÄÏÞÖÆ£¬±ÈÈçÆ´½Ó×Ö·û´®¡¢Ñ­»·¡¢µÝ¹é¡¢ÒÔ¼°ÎÒÃÇÆ½Ê±¾­³£ÓõÄһЩ·½·¨¶¼²»¿ÉÒÔÓã¬ËûÓÐËû×Ô¼º×¨ÃŵÄÀà¿â¡£
btrace»¹ÌṩÁËVi ......

ÓÃjavaʵÏÖcache


ÔÚ¿ª·¢ÏîÄ¿¹¤³Ìʱ£¬¾­³£»áÓöµ½±£´æÄ³Ð©Öµ·Åµ½ÏµÍ³µÄcacheÖУ¬ÏÖÓÃCache.javaºÍCacheManager.javaÀ´¹ÜÀí¡£¾ßÌå´úÂë·Ö±ðÈçÏ£º
public class Cache {
       
private String key;
       
private Object value;
    &n ......

javaÖÐ×Ö·û´®×ª»»³Éʱ¼ä¸ñʽ×ܽá

javaÖÐ×Ö·û´®×ª»»³Éʱ¼ä¸ñʽ×ܽá
¹Ø¼ü×Ö: java ×Ö·û´® ʱ¼ä ¸ñʽ
ͨ¹ý³¤Ê±¼äµÄ¶Ôʱ¼ä²»Í¬¸ñʽµÄת»»£¬×Ô¼º¾õµÃÆäʵ¾ÍÊǶԺÁÃëÊýµÄ²Ù×÷
Java´úÂë
System.currentTimeMillis()  
System.currentTimeMillis()
µÃµ½´Ó1970Äê1ÔÂ1ÈÕµ½ÏÖÔڵĺÁÃëÊý£¬¾Í¿ÉÒÔת»»³É¸÷ÖÖµÄÐÎʽ¡£
ÓÐÕâÑùÒ»¸ö×Ö·û´®£º“ ......

JAVAºÍPHP»ñÈ¡mysql×îºó²åÈëµÄ×ÔÔöidÖµ

phpºÍjavaͨÓÃsqlÓï¾ä·¨
SELECT max(id) from table
¸Ã·½·¨ÔÚ¶àÏ̵߳ÈÇé¿öÏ¿ÉÄÜ»áÔì³É²»ÕýÈ·¡£
javaÈýÖÖ·½·¨
1¡¢¸ù¾ÝpsµÄgetGeneratedKeys
PreparedStatement ps = conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS); //ºìÉ«Êǹؼü
ps.executeUpdate(); //Ö´Ðкó
ResultSet rs = ps.getGeneratedKeys ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ