Dynamic Class Loading using Java Reflection API

http://viralpatel.net/blogs/java-dynamic-class-loading-java-reflection-api/ package net.viralpatel.itext.pdf; public class DemoClass { public String demoMethod(String demoParam) {System. out.println("Parameter passed: " + demoParam); return DemoClass.class.getName(); […]

Read More →

Generating unique IDs

http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#getGeneratedKeys() http://stackoverflow.com/questions/1376218/is-ther-a-way-to-retrieve-the-autoincrement-id-from-a-prepared-statement String sql = "INSERT INTO table (column1, column2) values(?, ?)"; stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); stmt.executeUpdate(); if(returnLastInsertId) { […]

Read More →

HTML encode/decode

http://stackoverflow.com/questions/599634/convert-html-character-back-to-text-using-java-standard-library /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code […]

Read More →

Tag Cloud