-----------------------------------------------
데이터 베이스 생성
1. 파일생성할 경로를 지정
2. 경로가 생성되어 있는지 확인
3. 이전에 생성된 파일이 존재할 수 있기에 삭제 및 생성
4. SQL Connect
5. stat로 Create 및 Insert Update 문장 사용 후 처리
----------------------------------------------
String basePath = (new StringBuilder()).append(EgovProperties.getProperty("Globals.sync.dir.path")).append(File.separator).append("empty").toString();
StringBuilder folderPath = new StringBuilder();
StringBuilder filePath = new StringBuilder();
folderPath.append(basePath).toString();
filePath.append(folderPath).append(File.separator).append("empty.db").toString();
String folderLayout = folderPath.toString();
fileLayout = filePath.toString();
File folder = new File(folderLayout);
File file = new File(fileLayout);
//폴더삭제
folder.delete();
if(folder.exists()){
/** DB Close */
this.db_close(fileLayout);
file.delete();
}else{
folder.mkdirs();
}
file.createNewFile();
log.debug("layoutFile );" + fileLayout);
Connection conn = this.getConnection(fileLayout);
java.sql.Statement stat = conn.createStatement();
'IT > java' 카테고리의 다른 글
JAVA File Upload (0) | 2016.10.05 |
---|---|
java에서 dom 사용 xpath (0) | 2016.09.14 |
JAVA BLOB 데이터 ORACLE 저장 (0) | 2016.09.14 |
Java hsahMap 과 iterator (1) | 2016.04.11 |
JAVA String과 StringBuffer 메소드 (0) | 2016.03.30 |