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

Java ¶ÔxmlÎļþµÄ¶Áд²Ù×÷

/**
* ÃèÊö£ºÊý¾Ý¿â³õʼ»¯»ù±¾Àà
*
* @×÷Õß ÍõȺ
* @´´½¨ÈÕÆÚ 2010-04-08
* @ÐÞ¸ÄÈË xxx
* @ÐÞ¸ÄÈÕÆÚ xxx
* @¼ì²éÈË xxx
* @¼ì²éÈÕÆÚ xxx
*/
import java.sql.SQLException;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.oumasoft.bstmanage.ibatis.SqlMapConfig;
import com.oumasoft.bstmanage.ibatis.data.JsgnPo;
import com.oumasoft.bstmanage.ibatis.data.Test;
import java.util.*;
import org.w3c.dom.*;
import java.io.*;
import javax.servlet.http.HttpServletRequest;
import javax.xml.transform.stream.*;
import org.w3c.dom.*;
import javax.xml.transform.*;
import javax.xml.parsers.*;
import javax.xml.transform.dom.*;
import org.apache.log4j.Logger;
import com.oumasoft.bstmanage.ibatis.dao.ClientDao;
public class InitDBDao{
static Logger logger = Logger.getLogger(ClientDao.class.getName());
static SqlMapClient sqlMap = null;
private static File file = null;//¶ÁдÎļþ
private static DocumentBuilderFactory factory = null;
private static DocumentBuilder builder = null;

/**
* ½«Ð޸ĵÄÄÚÈÝÌí¼Óµ½xmlÎļþÖÐ
* @param document xml½Úµã
* @param filename Îļþ·¾¶
* @return ÊÇ·ñдÈë³É¹¦
*/
public static boolean doc2XmlFile(Document document, String filename) {
boolean flag = true;
try {
/** ½«documentÖеÄÄÚÈÝдÈëÎļþÖÐ */
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
/** ±àÂë */
//transformer.setOutputProperty(OutputKeys.ENCODING, "GBK");
DOMSource source = new DOMSource(document);
//ÅжÏ·¾¶¿ªÍ·ÓÐûÓГ\”Èç¹ûÓÐÔòÈ¥µô
filename = "C".equals(filename.charAt(0)) ? filename : filename.substring(1);
StreamResult result = new StreamResult(new FileOutputStream(filename));
transformer.transform(source, result);
} catch (Exception ex) {
flag = false;
ex.printStackTrace();
}
return flag;
}
/**
* ¶ÁÈ¡xmlÎļþ
* @param filename Îļþ·¾¶
* @return Îļþ½Úµã
*/
public stati


Ïà¹ØÎĵµ£º

Java ÖеÄIO






<!--
@page { margin: 0.79in }
P { margin-bottom: 0.08in }
-->

JavaÖеÄ
io

ÎÒ¶ÔÁ÷µÄÀí½âÊÇ£ºÔ´µ½Ä¿µÄµØµÄ¹ì¼££¬ËùÒÔÁ÷µÄÒ»¶ËÊÇÊý¾ÝÔ´£¨ÊäÈëÁ÷£©»òÕß½ÓÊÕÆ÷£¨Êä³öÁ÷£©£¬ÁíÒ»¶ËÊÇ
ioÖеÄij¸öÀࣻÕâÀï˵Ã÷Ï£¬
Scanne ......

²ÉÓÃJavaµÄÀà½øÐÐmd5¼ÓÃÜ

´úÂëÈçÏ£º
package com.test.j2se;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5 {
/**Êý¾Ý¼ÓÃÜ
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
MessageDigest code = MessageD ......

JAVA NIO TCP SOCKET ÁÄÌìȺ·¢

ÒÔÇ°¶¼ÊÇÓÃÒ»°ãµÄsocket±à³Ì£¬ÓÃÏß³ÌÀ´¿ØÖÆ¡£×î½üͻȻÓÃnioÀ´×öЩ¶«Î÷¡£
nioµÄºÃ´¦ÎÒÀ´ËµÒ»Ï£ºµÚÒ»£¬¶Áд¶¼ÊÇ»ùÓÚ¿éµÄ£¬Ð§Âʸߡ£µÚ¶þ£¬Í¨¹ýÒýÈëselector,¼ò»¯ÁËÍøÂç±à³ÌÄ£ÐÍ£¬Òì²½·Ç×èÈû¡£
¼ÈÈ»ÓÐÕâô¶àºÃ´¦£¬ÄǾÍд¸öNIO TCPÍøÂçÁÄÌìÊÒÀ´Á·Á·ÊÖ°É¡£
ÒòΪûÓÐдgui£¬ÊÇ»ùÓÚ¿ØÖÆ̨µÄËùÒÔûд˽Á˵IJ¿·Ö£¬Ö»Ð´Á˹«¹²ÁÄÌìÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ