xml/propertiesÎļþµÄÏ໥±£´æת»¯
/*
Á·Ï°Ê¹ÓÃjava.util.propertiesÀà°üÀ´²Ù×÷propertes¼°XMLÎļþ,ͨ¹ýstore·½·¨µÄµ÷ÓÿÉʵÏÖxml/propertiesÎļþµÄÏ໥±£´æת»¯
*/
import java.util.*;
import java.io.*;
public class TestPropertes
{
public static void main(String[] args) {
Properties pp = new Properties();
FileInputStream in = null;
FileInputStream xmlin = null;
FileOutputStream out = null;
PrintStream ps=null;
FileOutputStream xmlout =null;
try{
in = new FileInputStream("c:/Test.Properties");
}catch(FileNotFoundException e)
{
System.out.println("propertiesÎļþûÓÐÕÒµ½");
}
try
{
pp.load(in);
}catch(IOException e)
{
System.out.println(e+"µ÷ÓÃload·½·¨Ê±³öÏÖÒì³£");
}
System.out.println(pp.getProperty("log4j.rootLogger"));
System.out.println(pp.getProperty("log4j.appender.A"));
System.out.println(pp.getProperty("log4j.appender.A1.layout"));
try
{
ps = new PrintStream("c:/TestMemo.txt");
out = new FileOutputStream("c:/Test.Properties");
}catch(IOException e1)
{
System.out.println(e1+"PrintStream creat Error");
}
pp.list(ps); //½«propertiesÎļþÓÃlist·½·¨¶ÁÈ¡²¢´æÈëpsÎļþÖÐ
//¸ü¸Ä¼üÖµ
Object o =pp.setProperty("log4j.rootLogger","DEBUG,B"); //¸ü¸Ä¶ÔÓ¦µÄHASHTABLEÖеÄÖµ£¬Êµ¼ÊÉÏÎļþÖеÄֵû±ä»¯
System.out.println(pp.getProperty("log4j.rootLogger"));
pp.list(ps); //½«¼üÖµ¸ü¸ÄºóµÄpropertiesÎļþÓÃlist·½·¨¶ÁÈ¡²¢´æÈëpsÎļþÖÐ.list»á×Ô¶¯ÒÔ×·»ØµÄ·½Ê½´ÓÔÎļþβдÈë
System.out.println(o.getClass());
try
{
&nbs
Ïà¹ØÎĵµ£º
//»ñÈ¡Êý¾Ý¿âÊý¾Ý·µ»Ølist
public List queryAll(int fcateId) {
List list = new ArrayList();
String sql = "select * from g_Account where fCateID=? order by fCode";
Connection con = SqlHelp.getConn();//»ñµÃÁ¬½Ó£¬sqlhelp×Ô¼ºÐ´µÄ¹¤¾ßÀà
PreparedStatement pst = null;
ResultSet rs = null;
......
XML±»Éè¼ÆÓÃÀ´ÃèÊöÊý¾Ý£¬Æä½¹µãÊÇÊý¾ÝµÄÄÚÈÝ¡£
HTML±»Éè¼ÆÓÃÀ´ÏÔʾÊý¾Ý£¬Æä½¹µãÊÇÊý¾ÝµÄÍâ¹Û¡£
Ó¦¸ÃÕÆÎյĻù´¡ÖªÊ¶£º
ÔÚÄú¼ÌÐøѧϰ֮ǰ£¬ÐèÒª¶ÔÒÔÏÂ֪ʶÓлù±¾µÄÁ˽⣺
HTML / XHTML
JavaScript or VBScript
ʲôÊÇXML?
XMLÖ¸¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ£¨EXtensible Markup Language£©
XMLÊÇÒ»Ö ......
XML£¨Extensible Markup Language£©¼´¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ£¬ËüÓëHTMLÒ»Ñù£¬¶¼ÊÇSGML(Standard Generalized Markup Language,±ê׼ͨÓñê¼ÇÓïÑÔ)¡£XmlÊÇInternet»·¾³Öпçƽ̨µÄ£¬ÒÀÀµÓÚÄÚÈݵļ¼Êõ£¬Êǵ±Ç°´¦Àí½á¹¹»¯ÎĵµÐÅÏ¢µÄÓÐÁ¦¹¤¾ß¡£À©Õ¹±ê¼ÇÓïÑÔXMLÊÇÒ»ÖÖ¼òµ¥µÄÊý¾Ý´æ´¢ÓïÑÔ£¬Ê¹ÓÃһϵÁмòµ¥µÄ±ê¼ÇÃèÊöÊý¾Ý£¬¶øÕâЩ±ê¼Ç¿ÉÒÔÓà ......
ÈçºÎ¼ÓÔØÓÐÍâ¹úºÍÌØÊâ×Ö·ûµÄÎĵµ£¿
¡¡¡¡Îĵµ¿ÉÒÔ°üº¬Íâ¹ú×Ö·û£¬ÀýÈ磺
¡¡¡¡foreign characters (úóí?)
¡¡¡¡ÀýÈç íá µÄÍâ¹ú×Ö·û±ØÐëÔÚÇ°Ãæ¼ÓÉÏ escape ÐòÁС£Íâ¹ú×Ö·û¿ÉÒÔÊÇ UTF-8 ±àÂë»òÓò»Í¬±àÂëÖ¸¶¨£¬ÈçÏÂËùʾ£º
¡¡¡¡foreign characters (íá)
¡¡¡ ......
ÈçºÎÔÚSqlserverÖдÓÍⲿXMLÎļþÖжÁÈ¡ÅäÖÃÐÅÏ¢ÄØ£¿¸ÃÎÊÌâÔ´×ÔÒ»¼ÒÆóÒµµÄ±ÊÊÔÐÅÏ¢ÓиС£
Ò»xmlÎļþÄÚÈÝ£º
<?xml version="1.0" encoding="utf-8"?>
<root>
<db name="ClientDB1" datasize="512MB" datagrowth="100MB" logsize="100MB" loggrowth ="50MB">
</db>
<db ......