one problem of chemaxon.jchem.db.Exporter

User a9431cd809

23-04-2008 02:52:39

Hello everybody:


I want to export some data from my database,I used the method of chemaxon.jchem.db.Exporter,but have some problem:


the code is :


Exporter exporter = new Exporter();


exporter.setConnectionHandler(ch);


exporter.setSelectStatement("select A.CD_STRUCTURE, A.CD_ID FROM A");


exporter.setFormat(2);


exporter.setOutputStream(os);


exporter.writeAll();


but throw exception:


java.lang.NullPointerException


at chemaxon.jchem.db.SQLToFileHandler.dbRowToRecord(SQLToFileHandler.java:320)


at chemaxon.jchem.db.SQLToFileHandler.writeNext(SQLToFileHandler.java:454)


at chemaxon.jchem.db.Exporter.writeNext(Exporter.java:342)


at chemaxon.jchem.db.Exporter.writeAll(Exporter.java:363)I'm sure my database has CD_ID column.


When I writed it like this:


exporter.setSelectStatement("select A.CD_STRUCTURE FROM A");


the code run well.


My question is:


Why throw this exception when I create other columns?


How to run this sql successfully?

ChemAxon 9c0afc9aaf

23-04-2008 07:24:26

Hi,





Please let us know


- your JChem version


- what RDBMS are you using





Best regards,





Szilard

User a9431cd809

23-04-2008 09:40:43

Szilard wrote:
Hi,





Please let us know


- your JChem version


- what RDBMS are you using





Best regards,





Szilard
Hello:


my JChem version is 5.0.0,and I'm using oracle database.


thanks.

ChemAxon 9c0afc9aaf

23-04-2008 10:09:23

Hi,





This bug was fixed in JChem 5.0.1.


I suggest you to upgrade to the latest version.





Best regards,





Szilard