How to copy a row from existing excel sheet to a new excel sheet using Apache POI

source :http://stackoverflow.com/questions/22627691/how-to-copy-a-row-from-existing-excel-sheet-to-a-new-excel-sheet-using-apache-po public class RowCopy { public static void main(String[] args) throws Exception{ HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(“c:/input.xls”)); HSSFSheet sheet = workbook.getSheet(“Sheet1”); copyRow(workbook, sheet, 0, 1); FileOutputStream out = new FileOutputStream(“c:/output.xls”); workbook.write(out); out.close(); } private static void copyRow(HSSFWorkbook workbook, HSSFSheet worksheet, int sourceRowNum, int destinationRowNum) { // Get the source / new row HSSFRow… Continue reading How to copy a row from existing excel sheet to a new excel sheet using Apache POI

Delete From in Not In in Postgresql

command ini digunakan saat ingin delete table dengan kondisi yang disebut yang tidak didelete DELETE FROM otp.msection WHERE ssect NOT IN (‘4210’) and ssect NOT IN (‘4220’) and ssect NOT IN (‘4310’) and ssect NOT IN (‘4320’) and ssect NOT IN (‘4110’) and ssect NOT IN (‘4120’) and ssect NOT IN (‘4130’) and ssect NOT… Continue reading Delete From in Not In in Postgresql

XML parse file from HTTP

sumber : http://stackoverflow.com/questions/3058434/xml-parse-file-from-http ini adalahcara untuk ambil data xml dari url di internet kemudian dibuka file xml tersebut dan diurai diambil datanya. caranya seperti ini : private void start() throws Exception { URL url = new URL(“http://localhost:8080/AutoLogin/resource/web.xml&#8221;); URLConnection connection = url.openConnection(); Document doc = parseXML(connection.getInputStream()); NodeList descNodes = doc.getElementsByTagName(“description”); for(int i=0; i<descNodes.getLength();i++) { System.out.println(descNodes.item(i).getTextContent()); }… Continue reading XML parse file from HTTP

Cara Membuat Tombol Run Macro di Excel 2010

Kalau kita sudah membuat program macro. kita ingin menaruhnya shortcutnya di bagian toolbar excel gimana caranya. 1. buka file excel –> Option 2.Dibagian kiri pilih command from Macros. bagian kanan pilih tab Developer –> New Group (jika ingin ditaruh di tab Developer) 3.Dibagian kiri ada list program-program macro yang bisa kita buat shortcutnya. dibagian kanan… Continue reading Cara Membuat Tombol Run Macro di Excel 2010