?? scoredaoimpbyweb.java
字號:
/**
*
*/
package exam.dao;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import exam.model.Student;
/**
* @author 董曉煒
*
* Feb 14, 2009 11:19:30 AM
*/
public class ScoreDaoImpByWeb implements ScoreDao {
private Socket s;
private Student stu;
public ScoreDaoImpByWeb(Socket s,Student stu){
this.s=s;
this.stu=stu;
}
public void addScore(String id, char sco,int score, String subject) {
PrintWriter pw=null;
try {
pw = new PrintWriter(new OutputStreamWriter(s.getOutputStream(),"UTF-8"));
pw.println("score:"+id+":"+stu.getName()+":"+subject+":"+sco+":"+score);
pw.flush();
} catch (IOException e) {
if(s!=null){
e.printStackTrace();
try {
s.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -