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
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
var
xmlDoc
=
null
;
function
parseXML
(
xmlUrl
)
{
¡¡¡¡try
{
¡¡¡¡¡¡¡¡//IE
¡¡¡¡¡¡¡¡xmlDoc
=
new
ActiveXObject
(
"Microsoft.XMLDOM"
);
¡¡¡¡¡¡¡¡xmlDoc
.
async
=
false
;
¡¡¡¡¡¡¡¡xmlDoc
......
public int createXMLFile(String filename) {
int returnValue = 0;
Document document = DocumentHelper.createDocument(); //Éú³ÉDocument£¬ÓÃÓÚ¹ÜÀíXMLÎĵµ
Element booksElement = document.addElement("books"); //Ìí¼Ó ......
¹²ÏíÄÚ´æÔÚJavaÖÐʵÏÖºÍÓ¦ÓÃ
Õª×Ôhttp://zc4530.javaeye.com/blog/326186
1¡¢¹²ÏíÄÚ´æ¶ÔÓ¦Ó¦Óÿª·¢µÄÒâÒå
¶ÔÊìÖªUNIXϵͳӦÓÿª·¢µÄ³ÌÐòÔ±À´Ëµ£¬IPC£¨InterProcess Communication£©»úÖÆÊǷdz£ÊìϤµÄ£¬IPC»ù±¾°üÀ¨¹²ÏíÄÚ´æ¡¢ÐźŵƲÙ×÷¡¢ÏûÏ¢¶ÓÁС¢ÐźŴ¦ÀíµÈ²¿·Ö£¬ÊÇ¿ª·¢Ó¦ÓÃÖзdz£ÖØÒªµÄ±Ø²»¿ÉÉٵŤ¾ß¡£ÆäÖй²Ï ......
1. Multiply-Thread
Locks offer two primary features: mutual exclusion and visibility. Mutual exclusion means only one thread at a time may hold a given lock, so only one thread at a time will be using the shared data. Visibility is to ensure that changes made to shared data prior to releasing a lo ......