User ceff79a960
18-04-2008 15:33:50
hello all, I am a student who wants to build a chimical database , and I want to save the exacmass and the formula to database, and I have tried to use the API of ElementalAnalyserPlugin, but it came out always the erreurs "Unhandled exception type PluginException "
here is my code :
package masstest;
import chemaxon.formats.*;
import chemaxon.marvin.plugin.*;
import chemaxon.struc.*;
import java.util.Properties;
import java.lang.*;
import java.io.*;
import chemaxon.calculations.*;
public class calcul {
public static void main(String[] args) {
ElementalAnalyserPlugin elemanal = new ElementalAnalyserPlugin();
// run plugin on target molecules
MolImporter mi = new MolImporter(input.smiles);
Molecule mol = null;
while ((mol = mi.read()) != null) {
// set target molecule
elemanal.setMolecule(mol);
double exactMass = elemanal.getExactMass();
String formula = elemanal.getFormula();
// now use the results...
}
}
}
Can anyone help me ? thank you
here is my code :
package masstest;
import chemaxon.formats.*;
import chemaxon.marvin.plugin.*;
import chemaxon.struc.*;
import java.util.Properties;
import java.lang.*;
import java.io.*;
import chemaxon.calculations.*;
public class calcul {
public static void main(String[] args) {
ElementalAnalyserPlugin elemanal = new ElementalAnalyserPlugin();
// run plugin on target molecules
MolImporter mi = new MolImporter(input.smiles);
Molecule mol = null;
while ((mol = mi.read()) != null) {
// set target molecule
elemanal.setMolecule(mol);
double exactMass = elemanal.getExactMass();
String formula = elemanal.getFormula();
// now use the results...
}
}
}
Can anyone help me ? thank you