It seems problem with the way your are adding class path entries:
replace:
compilationUnit.addClassPathEntry("G:/project/eclispe/www.spade.com/src/com/ibm/database/DbConnection.java");
with
compilationUnit.addClassPathEntry("G:/project/eclipse/www.spade.com/src/");
And remove the other entry as you are trying to add same class.Hope this helps.