Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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Öм¯ºÏÈÝÆ÷ÀàListºÍSetµÄÓ÷¨

ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1  List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......

¹ØÓÚjavaµÄclasspathÎÊÌâ


package¡¢import
µÄÏà¹ØÎÊÌâÊÇjavaÖеÄÒ»¸ö²»´ó²»Ð¡µÄÎÊÌ⣬µ«classpathÎÊÌâÈ´ÊÇjavaµÄÒ»¸öÖøÃûµÄÄÑÌâ¡£½ñÍíµÃÏÐÑо¿ÁËһϣ¬ÔÚÕâÀォÎÒµÄÑо¿³É¹û¸ú¸÷λ
ÅóÓÑ·ÖÏíһϡ£ÓÉÓÚͬ°üµÄÇé¿öºÜ¼òµ¥£¬ËùÒÔÕâÀï¾Í²»ÌÖÂÛͬ°üÇé¿ö£¬Ö»ÌÖÂÛ²»Í¬°üºÍ²»Í¬Â·¾¶µÄÇé¿ö¡£ÎªÁËÄÜÈöÁÕ߸üÈÝÒ×Àí½â£¬ÎÒÕâÀïÒÔ¾ÙÀýµÄ·½Ê½À´ËµÃ÷ÎÊ
Ìâ¡£
¡ ......

javascript¿çä¯ÀÀÆ÷´´½¨XML¶ÔÏó


var
 
xmlDoc
 
=
 
null
;
function
 
parseXML
(
xmlUrl
)
{
¡¡¡¡try
 
{
¡¡¡¡¡¡¡¡//IE
¡¡¡¡¡¡¡¡xmlDoc
 
=
 
new
 
ActiveXObject
(
"Microsoft.XMLDOM"
);
¡¡¡¡¡¡¡¡xmlDoc
.
async
 
=
 
false
;
¡¡¡¡¡¡¡¡xmlDoc ......

Java±à³Ìʵ¼ùÓ¦ÓãºJ2EE¼Ü¹¹µÄ6¸ö×î¼Ñʵ¼ù


2008-04-26 09:25 ×÷Õߣºsuperman À´Ô´£ºÈüµÏÍø
[ÕªÒª] Ê×ÏÈ£¬±¾ÎĵÄÄ¿±ê¶ÁÕßÊÇÕýÔÚ´Óʼ¼Êõ¹¤×÷µÄ¼Ü¹¹Ê¦¡£±ÜÃâ½²ÊöһЩ³Â¸¯µÄ×î¼Ñʵ¼ù£¬ÀýÈç"ÈÕ³£¹¹½¨£¨build daily£©"¡¢"²âÊÔÒ»ÇУ¨test everything£©"ºÍ"¾­³£¼¯³É£¨ integrate often£©¡£ ÈκξßÓгÆÖ°¼Ü¹¹Ê¦µÄÏîÄ¿¶¼Óзֹ¤Ã÷È·µÄ¡¢¶¨ÒåÁ¼ºÃµÄÍŶӽṹ¡£ËûÃÇ»¹Îª½øÐбà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ