2010-11-23 6 views
3

내 웹 응용 프로그램은 아카이브를 받고 임시 폴더에 압축을 푼 다음 추출 된 DBF에서 데이터를 읽은 다음 가비지를 제거해야합니다. temp 폴더는 DBF 파일이 잠겨 있기 때문에 죽이지는 않지만 실패합니다. 다음은 샘플 코드는 다음과 같습니다hxtt DBF 드라이버가 파일을 잠급니다.

public static void main(String a[]) throws Exception {

Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance(); 
    String url = "jdbc:DBF:/C:/TEMP/"; 
    Properties properties = new Properties(); 
    properties.setProperty("charSet", "cp866"); 
    Connection con = null; 
    Statement st = null; 
    java.sql.Driver d = null; 
    con = DriverManager.getConnection(url, properties); 
    d = DriverManager.getDriver(url); 
    st = con.createStatement(); 
    ResultSet rs = st.executeQuery("SELECT * FROM 6QQQ201010"); 
    rs.close(); 
    st.close(); 
    con.close(); 

}

나는 마지막 줄지나 중단 점을 넣어 6QQQ201010.DBF은 여전히 ​​잠겨 있습니다. 어떤 아이디어? 아니면 운전사의 버그?

답변

2

속성을 추가하십시오. properties.setProperty ("delayedClose", "0"); 운전자는 즉시 핸들을 닫을 것입니다.

관련 문제