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?
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?