Email with attachment

Sending HTML Forwarding email Deleting email https://www.javatpoint.com/example-of-sending-attachment-with-email-using-java-mail-api next>> <<prev Sending email with attachment in Java For sending email with attachment, JavaMail API provides some useful classes like BodyPart, MimeBodyPart etc. For better understanding of this example, learn the steps of sending email using JavaMail API first. For sending the email using JavaMail API, you need… Continue reading Email with attachment

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