JavaµÄIOʵÀý
//JavaµÄIOµÄÒ»¸öʵÀý
import java.io.*;
import java.util.zip.*;
public class abc5{
String temp=new String();
String t=new String();
public void readByLinefromConsoleAndPrint(){
System.out.println("==´Ó¿ØÖÆÌ¨»ñµÃÊäÈë==");
try{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.println("ÇëÊäÈëÒ»ÐÐ×Ö·û£º");
System.out.println(temp=in.readLine());
}
catch(IOException e){
e.printStackTrace();
}
}
public void readByLinefromFileAndPrint(){
System.out.println("==´ÓÎļþ»ñµÃÊäÈë==");
try{
BufferedReader in=new BufferedReader(new FileReader("abc.dat"));
temp="";
String s=new String();
while((s=in.readLine())!=null)
temp+=s+"\n";
in.close();
System.out.println(temp);
}
catch(FileNotFoundException e){
e.printStackTrace();
}
catch(IOException e){
e.printStackTrace();
}
}
public void readfromMemoryAndPrint(){
System.out.println("==´ÓÄÚ´æ»ñµÃÊäÈë==");
try{
StringReader stringReader=new StringReader(temp);
int t;
while((t=stringReader.read())!=-1)
System.out.println((char)t);
}
catch(IOException e){
e.printStackTrace();
}
}
public void writeToFile()
{
System.out.println("==ÎļþÊä³öÁ÷==");
try{
BufferedReader in=new BufferedReader(new StringReader(temp));
PrintWriter out=new PrintWriter(new BufferedWriter(new FileWriter("abc.dat")));
while((t=in.readLine())!=null)
o
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔǰ£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
±¾ÎĽ«¸æËßÄãѧϰJavaÐèÒª´ïµ½µÄ25¸öÄ¿±ê£¬Ï£ÍûÄܹ»¶ÔÄãµÄѧϰ¼°ÕÒ¹¤×÷ÓÐËù°ïÖú¡£¶Ô±ÈÒ»ÏÂ×Ô¼º£¬ÄãÒÑ¾ÕÆÎÕÁËÕâ25ÌõÖеĶàÉÙÌõÁËÄØ?¡¡¡¡1.ÄãÐèÒª¾«Í¨ÃæÏò¶ÔÏó·ÖÎöÓëÉè¼Æ(OOA/OOD)¡¢É漰ģʽ(GOF£¬J2EEDP)ÒÔ¼°×ÛºÏģʽ¡£ÄãÓ¦¸ÃÁ˽âUML£¬ÓÈÆäÊÇclass£¬object£¬interactionÒÔ¼°statediagrams¡£
¡¡¡¡2.ÄãÐèҪѧϰJavaÓïÑԵĻù´ ......
Ö÷ÒªµÄ³ÌÐò£º
package greeds.jdbc.sample;
import greeds.jdbc.util.JDBCUtil;
import java.io.*;
import java.sql.*;
public class MySQLBlobSample {
public static void main(String[] args) throws Exception {
// дÈëÊý¾Ý¿â
/*
*
* Connection ......
¹éÄÉÒ»Ð©ÍøÉÏÈ¡JAVA·¾¶µÄ·½·¨£º
×¢Ã÷£ºÈç¹û´ÓANTÆô¶¯³ÌÐò£¬this.getClass().getResource("")È¡³öÀ´µÄ±È½Ï¹Ö£¬Ö±½ÓÓÃJAVAÃüÁîÐе÷ÊԾͿɳɹ¦¡£
µÃµ½classpathºÍµ±Ç°ÀàµÄ¾ø¶Ô·¾¶µÄһЩ·½·¨
»ñµÃCLASSPATHÖ®Íâ·¾¶µÄ·½·¨£º
URL
base = this.get ......