일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- profile
- Quartz
- import
- Mac
- find
- Eclipse
- bash
- resource
- ssh
- Windows 10
- 줄바꿈 문자
- GIT
- grep
- Windows
- vscode
- Source
- plugin
- maVen
- JavaScript
- netsh
- context
- web.xml
- VirtualBox
- xargs
- IntelliJ
- 단축키
- 네트워크
- lsof
- port
- tomcat
- Today
- Total
목록Dev/Java (163)
develog
java -classpath "클래스패스1;클래스패스2;" 패키지경로.클래스명ex) java -classpath "E:/aa/bb.jar;E:/cc/;" com.mysite.TestMain
public void readXSSF() { InputStream in = null; try { File sourceFile = new File("c:/sample.xls"); in = new FileInputStream(sourceFile); Workbook wb = WorkbookFactory.create(in); Sheet sheet = wb.getSheetAt(0); for (Iterator rit = sheet.rowIterator(); rit.hasNext(); ) { Row row = rit.next(); for (Iterator cit = row.cellIterator(); cit.hasNext(); ) { Cell cell = cit.next(); System.out.print(cell ..
public void writeXSSF() { FileOutputStream fileOut = null; try { Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet("new sheet"); Row row = sheet.createRow(0); Cell cell = row.createCell(0); cell.setCellValue("wefwefwefwe"); fileOut = new FileOutputStream("c:/testXSSF.xlsx"); wb.write(fileOut); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.print..
type 1----------------------------------------------------------for (Iterator rit = sheet.rowIterator(); rit.hasNext(); ) { Row row = rit.next(); for (Iterator cit = row.cellIterator(); cit.hasNext(); ) { Cell cell = cit.next(); System.out.print(cell + "\t"); } System.out.println();} type 2---------------------------------------------------------- for (Row row : sheet) { for (Cell cell : row) { ..
private static void jdbcTest() { try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:SID", username, password); DatabaseMetaData metaData = conn.getMetaData(); System.out.println(metaData.getDatabaseProductVersion()); System.out.println(metaData.getDriverName()); System.out.println(metaData.getDriverVersion()); }..
Java------------------------------------- public static void exceptionTest() { System.out.println("1"); try { System.out.println("2"); throwException(); // 예외발생! System.out.println("3"); } catch (Exception e) { System.out.println("4"); } finally { System.out.println("5"); } System.out.println("6");} 결과-------------------------------------12456