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 Socket³¬Ê±Ç³Îö
Ì×½Ó×Ö»ò²å×ù(socket)ÊÇÒ»ÖÖÈí¼þÐÎʽµÄ³éÏó£¬ÓÃÓÚ±í´ïÁ½Ì¨»úÆ÷¼äÒ»¸öÁ¬½ÓµÄ“Öն˔¡£Õë¶ÔÒ»¸öÌض¨µÄÁ¬½Ó£¬Ã¿Ì¨»úÆ÷É϶¼ÓÐÒ»¸ö“Ì×½Ó×Ö”£¬¿ÉÒÔÏëÏóËüÃÇÖ®¼äÓÐÒ»ÌõÐéÄâµÄ“ÏßÀ”¡£JAVAÓÐÁ½¸ö»ùÓÚÊý¾ÝÁ÷µÄÌ×½Ó×ÖÀࣺServerSocket£¬·þÎñÆ÷ÓÃËü“ÕìÌý&rdquo ......
<?
XML DOM¶ÁÈ¡½ÚµãÐÅÏ¢Óöµ½ÎÊÌâ×ܽ᣺
1:NodeList: ʹÓýڵãµÄchildNodesÊôÐÔ»òÕßdocument¶ÔÏóµÄgetElementsByTagName()·½·¨£¬¾Í»á·µ»ØÒ»¸ö°üº¬½ÚµãÁбíµÄNodeList
2: ÔÚ XML DOM ÖУ¬½ÚµãµÄ¹Øϵ±»¶¨ÒåΪ½ÚµãµÄÊôÐÔ£º
· parentNode
· childNodes
· ......
¹²ÏíÄÚ´æÔÚJavaÖÐʵÏÖºÍÓ¦ÓÃ
Õª×Ôhttp://zc4530.javaeye.com/blog/326186
1¡¢¹²ÏíÄÚ´æ¶ÔÓ¦Ó¦Óÿª·¢µÄÒâÒå
¶ÔÊìÖªUNIXϵͳӦÓÿª·¢µÄ³ÌÐòÔ±À´Ëµ£¬IPC£¨InterProcess Communication£©»úÖÆÊǷdz£ÊìϤµÄ£¬IPC»ù±¾°üÀ¨¹²ÏíÄÚ´æ¡¢ÐźŵƲÙ×÷¡¢ÏûÏ¢¶ÓÁС¢ÐźŴ¦ÀíµÈ²¿·Ö£¬ÊÇ¿ª·¢Ó¦ÓÃÖзdz£ÖØÒªµÄ±Ø²»¿ÉÉٵŤ¾ß¡£ÆäÖй²Ï ......
¾õµÃÁôÑÔºÜÓеÀÀí£¬ÎÄÕºÜÕÜÀí£¬Ò»²¢×ªÔØ ½¨Òé¶ÁÕß¿´ÔÎĵØÖ·
×÷Õߣº ÈîÒ»·å
ÈÕÆÚ£º 2008Äê12Ô 7ÈÕ
ÏÂÃæµÄÎÄÕÂÊÇMore Joel on SoftwareÒ»ÊéµÄµÚ8ƪ¡£
ÎÒ¾õµÃ·ÒëÄѶȺܴó£¬ÕûÕûÁ½¸ö¹¤×÷ÈÕ£¬Ã¿Ìì8СʱÒÔÉÏ£¬²ÅÒë³öÁË5000×Ö¡£³ýÁËJoel´óÁ¿Ê¹ÓÃÙµÓÁíÒ»¸öÔÒòÊÇÔÎÄÉæ¼°"±à³ÌÔÀí"£¬ºÃ¶à¶«Î÷ÎÒ¸ù±¾²»¶®¡£Ï£ ......
ÒÔÇ°¶¼ÊÇÓÃÒ»°ãµÄsocket±à³Ì£¬ÓÃÏß³ÌÀ´¿ØÖÆ¡£×î½üͻȻÓÃnioÀ´×öЩ¶«Î÷¡£
nioµÄºÃ´¦ÎÒÀ´ËµÒ»Ï£ºµÚÒ»£¬¶Áд¶¼ÊÇ»ùÓÚ¿éµÄ£¬Ð§Âʸߡ£µÚ¶þ£¬Í¨¹ýÒýÈëselector,¼ò»¯ÁËÍøÂç±à³ÌÄ£ÐÍ£¬Òì²½·Ç×èÈû¡£
¼ÈÈ»ÓÐÕâô¶àºÃ´¦£¬ÄǾÍд¸öNIO TCPÍøÂçÁÄÌìÊÒÀ´Á·Á·ÊÖ°É¡£
ÒòΪûÓÐдgui£¬ÊÇ»ùÓÚ¿ØÖÆ̨µÄËùÒÔûд˽Á˵IJ¿·Ö£¬Ö»Ð´Á˹«¹²ÁÄÌìÊ ......