java ioÕýÈ·¶ÁÈ¡
дÈë
public static void Writer(String value) {
try{
File file2 = new File("F:\\countDB.txt");
if(!file2.exists()){
file2.createNewFile();
}
FileOutputStream writer = new FileOutputStream(file2,true);
OutputStreamWriter rp = new OutputStreamWriter(writer,"GBK");
BufferedWriter tmpBR = new BufferedWriter(rp,1024*1024);
tmpBR.write(value+"\r\n");
tmpBR.flush();
tmpBR.close();
rp.flush();
rp.close();
writer.flush();
writer.close();
}catch(Exception ex){
//ex.fillInStackTrace();
}
}
²éѯ
File file = new File("E:\\DB.txt");
FileInputStream read = new FileInputStream(file);
InputStreamReader rp = new InputStreamReader(read,"GBK");
BufferedReader tmpBR = new BufferedReader(rp,1024*1024);
String tmpLine = tmpBR.readLine();
while (tmpLine != null) {
&n
Ïà¹ØÎĵµ£º
´úÂëÈçÏ£º
1 String command = " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
2 try {
3 Process process& ......
×î½üÓöµ½Ò»¸öÐèÇóÒªÔÚlinuxÏÂÓÃjava µ÷ÓÃmysql¿Í»§¶ËÔ¶³ÌµÇ½mysql·þÎñÆ÷£¬´Ó¿Í»§¶Ë»úÆ÷µ¼Èëmysql½Å±¾£¬´Ómysql·þÎñÆ÷¶Ëµ¼³ö±íÖеÄÊý¾Ý¡£ÒÔÏÂÊÇÓõ½µÄÖ÷Òª·½·¨£º
Java ´úÂë
/**
* µ¼ÈëÊý¾Ý
* @param ½Å±¾µÄµØÖ·ºÍÃû³Æ
* @return ÊÇ·ñ³ ......
1. Êý×éÓÐûÓÐlength()Õâ¸ö·½·¨? StringÓÐûÓÐlength()Õâ¸ö·½·¨£¿
´ð£ºÊý×éûÓÐlength()Õâ¸ö·½·¨£¬ÓÐlengthµÄÊôÐÔ¡£
StringÓÐlength()Õâ¸ö·½·¨¡£
2. String s = new String("xyz") ......
11 Ò»¸öÔ´³ÌÐòÎı¾ÎļþÒ²¿ÉÒÔº¬Óжà¸öÀ࣬µ«Ã¿¸öÎļþÖ»ÄÜÓÐÒ»¸ö¹«¹²Àà¡£
12 mainÊÇËùÓÐJavaÓ¦ÓóÌÐòÖ´ÐеÄÈë¿Ú£¬µ«²»ÊÇJavaСӦÓóÌÐòµÄÈë¿Ú¡£
mainµÄÊôÐÔ±ØÐëÊÇpublic static void¡£
13 ÊýÖµÀàÐͼäµÄÇ¿Èõ¹ØÏµ
......
1¡£Ê¹ÓÃjava.util.PropertiesÀàµÄload()·½·¨
ʾÀý£º InputStream in = lnew BufferedInputStream(new FileInputStream(name));
Properties p = new Properties();
p.load(in);
2¡£Ê¹ÓÃjava.util.ResourceBundleÀàµÄgetBundle()·½·¨
ʾÀý£º ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault());
......