javaÎļþ¶Áд
Java ¶ÔÎļþ½øÐжÁд²Ù×÷µÄÀý×Ӻܶ࣬ÈóõѧÕ߸е½Ê®·ÖÀ§»ó£¬ÎÒ¾õµÃÓбØÒª½«¸÷ÖÖ·½·¨½øÐÐ
Ò»´Î·ÖÎö£¬¹éÀ࣬ÀíÇ岻ͬ·½·¨Ö®¼äµÄÒìͬµã¡£
Ò»£®ÔÚ JDK 1.0 ÖУ¬Í¨³£ÊÇÓà InputStream & OutputStream ÕâÁ½¸ö»ùÀàÀ´½øÐжÁд²Ù×÷µÄ¡£
InputStream ÖÐµÄ FileInputStream ÀàËÆÒ»¸öÎļþ¾ä±ú£¬Í¨¹ýËüÀ´¶ÔÎļþ½øÐвÙ×÷£¬ÀàËƵģ¬ÔÚ
OutputStream ÖÐÎÒÃÇÓÐ FileOutputStream Õâ¸ö¶ÔÏó¡£
ÓÃFileInputStream À´¶ÁÈ¡Êý¾ÝµÄ³£Ó÷½·¨ÊÇ£º
FileInputStream fstream = new FileInputStream(args[0]);
DataInputStream in = new DataInputStream(fstream);
Óà in.readLine() À´µÃµ½Êý¾Ý£¬È»ºóÓà in.close() ¹Ø±ÕÊäÈëÁ÷¡£
ÍêÕû´úÂë¼û Example 1¡£
ÓÃFileOutputStream À´Ð´ÈëÊý¾ÝµÄ³£Ó÷½·¨ÊÇ£º
FileOutputStream out out = new FileOutputStream("myfile.txt");
PrintStream p = new PrintStream( out );
Óà p.println() À´Ð´ÈëÊý¾Ý£¬È»ºóÓà p.close() ¹Ø±ÕÊäÈë¡£
ÍêÕû´úÂë¼û Example 2¡£
¶þÔÚ JDK 1.1ÖУ¬Ö§³ÖÁ½¸öеĶÔÏó Reader & Writer, ËüÃÇÖ»ÄÜÓÃÀ´¶ÔÎı¾Îļþ½øÐвÙ×÷£¬¶ø
JDK1.1ÖÐµÄ InputStream & OutputStream ¿ÉÒÔ¶ÔÎı¾Îļþ»ò¶þ½øÖÆÎļþ½øÐвÙ×÷¡£
ÓÃFileReader À´¶ÁÈ¡ÎļþµÄ³£Ó÷½·¨ÊÇ£º
FileReader fr = new FileReader("mydata.txt");
BufferedReader br = new BufferedReader(fr);
Óà br.readLing() À´¶Á³öÊý¾Ý£¬È»ºóÓÃbr.close() ¹Ø±Õ»º´æ£¬ÓÃfr.close() ¹Ø±ÕÎļþ¡£
ÍêÕû´úÂë¼û Example 3¡£
Óà FileWriter À´Ð´ÈëÎļþµÄ³£Ó÷½·¨ÊÇ£º
FileWriter fw = new FileWriter("mydata.txt");
PrintWriter out = new PrintWriter(fw);
ÔÚÓÃout.print »ò out.println À´ÍùÎļþÖÐдÈëÊý¾Ý£¬out.print ºÍ out.printlnµÄΨһÇø±ðÊǺóÕßд
ÈëÊý¾Ý»ò»á×Ô¶¯¿ªÒ»ÐÂÐС£Ð´ÍêºóÒª¼ÇµÃ ÓÃout.close() ¹Ø±ÕÊä³ö£¬ÓÃfw.close() ¹Ø±ÕÎļþ¡£
ÍêÕû´úÂë¼û Example 4¡£
Example 1
Java´úÂë
// FileInputDemo
// Demonstrates FileInputStream and DataInputStream
import java.io.*;
class FileInputDemo {
public static void main(String args[]) {
// args.length
Ïà¹ØÎĵµ£º
Ê×ÏÈ£¬×öÒ»µã˵Ã÷¡£FlexÊDz»ÄÜÖ±½ÓÁ¬½ÓÊý¾Ý¿âµÄ£¬ÕâÒ»µã´ó¼ÒÐèÒªÖªµÀ£¬ËüÖ»Äܼä½ÓµØÁ¬½ÓÊý¾Ý¿â¡£FlexÖÐÌṩÁËÈýÖÖ·½Ê½£ºHttpService£¬WebService ºÍRemoteObject¡£ÆäÖÐHttpService¿ÉÒÔÖ±½Ó»ñÈ¡XMLÖеÄÊý¾Ý£¬»¹¿ÉÒÔͨ¹ýJSP,ASPÒÔ¼°PHP¶ÁÈ¡Êý¾Ý¿âÖеÄÊý¾Ý£¬Õâ¸ö±È½Ï¼òµ¥£¬¶øÇÒÍøÉÏÒ²ÓкܶàÀý×Ó£¬ÎҾͲ»¶à˵ÁË¡£WebServi ......
Reflection ÊÇ Java ³ÌÐò¿ª·¢ÓïÑÔµÄÌØÕ÷Ö®Ò»£¬ËüÔÊÐíÔËÐÐÖÐµÄ Java ³ÌÐò¶Ô×ÔÉí½øÐмì²é£¬»òÕß˵“×ÔÉ󔣬²¢ÄÜÖ±½Ó²Ù×÷³ÌÐòµÄÄÚ²¿ÊôÐÔ¡£ÀýÈ磬ʹÓÃËüÄÜ»ñµÃ Java ÀàÖи÷³ÉÔ±µÄÃû³Æ²¢ÏÔʾ³öÀ´¡£
Java µÄÕâÒ»ÄÜÁ¦ÔÚʵ¼ÊÓ¦ÓÃÖÐÒ²ÐíÓõò»ÊǺܶ࣬µ«ÊÇÔÚÆäËüµÄ³ÌÐòÉè¼ÆÓïÑÔÖиù±¾¾Í²»´æÔÚÕâÒ»ÌØÐÔ¡£ÀýÈ磬Pasc ......
×î½üÏîÄ¿½ø¶È±È½Ï»ºÂý£¬³õ²½Ñо¿ÁËÒ»ÏÂOracleµÄ´æ´¢¹ý³Ì£¬½«´úÂëÌù³öÀ´¡£
Ê×ÏÈÏÈÌù³öÀ´OracleµÄ·ÖÒ³·ÖÒ³´æ´¢¹ý³Ì´úÂë°É¡£
1.ÕâÊÇ°üµÄ´úÂë
create or replace package DB_Oper is
-- Author : LIUBING
-- Created : 2009-10-28 15:01:30
-- Purpose : ²âÊÔOracleµ ......
¡¡¡¡Ê×ÏÈÒýÓÃһƪÎÄÕ£¬½éÉÜÒ»¸ö¼òµ¥µÄJNIµÄµ÷ÓõĹý³Ì¡£¡¡¡¡JAVAÒÔÆä¿çƽ̨µÄÌØÐÔÉîÊÜÈËÃÇϲ°®£¬¶øÓÖÕýÓÉÓÚËüµÄ¿çƽ̨µÄÄ¿µÄ£¬Ê¹µÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ£¬Ô¼ÊøÁËËüµÄ¹¦ÄÜ¡£½â¾öJAVA¶Ô±¾µØ²Ù×÷µÄÒ»ÖÖ·½·¨¾ÍÊÇJNI¡£¡¡¡¡JAVAͨ¹ýJNIµ÷Óñ¾µØ·½·¨£¬¶ø±¾µØ·½·¨ÊÇÒÔ¿âÎļþµÄÐÎʽ´æ·ÅµÄ£¨ÔÚWINDOWSƽ̨ÉÏÊÇDL ......
ÎÊÌ⣺ÏÖÓÐn¸öÀÏÊóΧ³ÉһԲȦ£¬ÓÐһֻè´ÓÈÎÒâλÖÿªÊ¼³ÔÀÏÊó£¬Ã¿´Î¶¼¸ôÒ»¸öÀÏÊó³Ô£¬Çë¸ø³ö×îºóÒ»¸öÀÏÊóµÄ±àºÅ£¿ÌâÄ¿ÒªÇóÊÇÈθøÀÏÊóÊýn£¬Êä³öè×îºó³ÔµÄÀÏÊóµÄ±àºÅ¡£
ÎҵĽⷨ£º
1.¼òµ¥µÄ·½·¨¾ÍÊÇÄ£ÄâÕâ¸ö¹ý³Ì¡£Ê¹ÓÃÒ»¸öÊý×é´ú±íÀÏÊóÊÇ·ñ±»³Ôµô£¬Ñ»·±éÀú¡£
2.¸Ä½øһϵķ½·¨£¬ÆäʵÕâ¸öÎÊÌâ¾ÍÊÇÒ»¸öm=2µÄԼɪ·ò»·ÎÊÌâ¡£
......