현재 내가 자바 응용 프로그램을 만들고 어떤 데이터베이스는 텍스트 파일을 사용하여 내가 그것을 를 만들기 위해 왜 파일의 구조는 내가이어떻게 자바 파일을 읽고 업데이트 행에
unique6id username identitynumber point
unique6id username identitynumber point
처럼 수 있음을 을 할 필요가 없습니다 어떻게하면 unique6id 매치를 읽고 포인트의 대응하는 행을 업데이트 할 수 있었는지 알 수 있습니까? 여기에 정보 의 부족에 대한 미안하고
내가 입력 한 부분이 내가 데이터 의 텍스트 방식은 다음 데이터 .txt 안에 결과가
spencerlim 900419129876 448505 0
Eugene 900419081234 586026 0
입니다
public class Cust{
string name;
long idenid, uniqueid;
int pts;
customer(){}
customer(string n,long ide, long uni, int pt){
name = n;
idenid = ide;
uniqueid = uni;
pts = pt;
}
FileWriter fstream = new FileWriter("Data.txt", true);
BufferedWriter fbw = new BufferedWriter(fstream);
Cust newCust = new Cust();
newCust.name = memUNTF.getText();
newCust.ic = Long.parseLong(memICTF.getText());
newCust.uniqueID = Long.parseLong(memIDTF.getText());
newCust.pts= points;
fbw.write(newCust.name + " " + newCust.ic + " " + newCust.uniqueID + " " + newCust.point);
fbw.newLine();
fbw.close();
입니다 586,026에서 사용자 입력이 다음은 커스트 로 유진 바인드 행 잡아와 PTS를 갱신 할 때 (이 경우에는 0이, 다른 숫자 등으로 업데이트하려고. 30)
답장을위한 Thumb = D
후 지금까지, 그리고 어떤 결과가 무엇인지. 사람들이 당신을 훨씬 더 잘 돕도록 도와 줄 것입니다! – corsiKa
세부 사항이 부족하여 죄송합니다.이 케이스의 정답은 D – 1myb