????java.io????? - PowerPoint PPT Presentation

About This Presentation
Title:

????java.io?????

Description:

Title: PowerPoint Author: bam Last modified by: bam Created Date: 1/11/2002 7:52:19 AM Document presentation format: – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 24
Provided by: BAM69
Category:

less

Transcript and Presenter's Notes

Title: ????java.io?????


1
?????9?
  • ????
  • ????java.io?????

2
Goal?Objective
  • Goal??????????????????????????
    ????????????????java.io??????????????????
    ?????????????????
  • Objective??????????????????????????java.io????
    ????????java.io?????????????????????

3
????????
  • ??????(CUI?) ??????????????

???????1.????? 2.??????? 3.????? 4.???????
5.??????? 6.?????????? 3 ????500? cola120?? sod
a120? ??????0????? ?????????0???????? ?????????
??????? cola cola??????? ????380??????
4
?????????????
  • ??????????????? ????????????????????

5
????????????
????????(???????????)??????????????????????????
6
????????
  • ????????

?????????????????RDB
??????????
7
lt??gt???????????????
  • ??

BufferedReader br new BufferedReader(new
FileReader(???1.log)) ??? br.readLine()
br.close()
  • ??

PrintWriter pwnew PrintWriter(newFileWriter(???1
.log)) fw.write(???) fw.close()
8
lt??gt?????????????
//DB?URL?????? String url
"jdbcinterbase//etude.crew.sfc.keio.ac.jp//home
/bam/jihanki.gdb" //DB???????????????
????? java.sql.Connection conn
java.sql.DriverManager.getConnection( url ,
"sysdba" , "masterkey" )
//SQL??????????????????(resultSet)?????
String sqlString "select from user_info"
java.sql.Statement statement
conn.createStatement() java.sql.ResultSet
rs statement.executeQuery( sqlString )
9
????????
?????????????????????? ?????????????
10
??????????lt??gt
  • ??

ObjectOutputStream ??
new ObjectOutputStream(new FileOutputStream(????.
log)) ??.writeObject(????)
??.close()
11
??????????lt??gt
  • ??

ObjectInputStream ?? new
ObjectInputStream(new FileInputStream(????.log)
) ????(?????)??.readObject() ??.close()
12
java.io.Serializable????????
public class ????? implements Serializable

13
????
  • BufferedReader
  • FileReader/Writer
  • PrintWriter
  • ObjectOutputStream/InputStream

????????????????????????????????????????
14
????????
????????????????????(??????????????????????)
15
java.io????????
???????????????????? ????????????????????
  1. ???????????????????????????????
  2. ??????????????????

16
???????
  1. ????InputStream/OutputStream????????
    (ObjectOutputStream/InputStream??)?)FileInputStre
    am?ByteArrayInputStream
  2. ???Reader/Writer?????????)FileReader?CharArrayWr
    iter
  3. ??????ObjectOutputStream/InputStream

17
????
  1. ????FileOutputStream/InputStream/Reader/Writer
  2. StringStringReader/Writer(String????????Stream??
    ????)
  3. ???????InputStreamReader


18
???
??????????????????
  • FileReader
  • ObjectInputStream
  • ByteArrayOutputStream

?????????????????
??????????????
?????byte????????????
19
??????????
  • BufferedReader ????????????????????
    ??????????????????? ???????
  • PrintWriter ?????????????????? ????????????????

20
???
BufferedReader br new BufferdeReader(new
InputStream(System.in)) String ??br.readLine()
?????????????????????????????
21
????
PrintWriter pw new PrintWriter(new
FileWriter("test.txt")) pw.println("test")
??????????????????????????
22
???
Java.io?????????????????????????????????
23
?????
?????????????????? ???????????????? ?????????
???????
Write a Comment
User Comments (0)
About PowerShow.com