User 79bcc43be0
07-03-2009 23:15:57
Hi i´m having troubles with the Importer:
Importer imp = new Importer();
imp.setConnectionHandler(getDataSource());
imp.setTableName(TABLE);
imp.setInput(file.getInputStream());
imp.setStoreImportedIDs(true);
System.out.println("Collecting file information ...");
imp.init();
I get the following error:
java.lang.NullPointerException
at chemaxon.jchem.db.TableInfo.getTableNameWithSchema(TableInfo.java:759)
at chemaxon.jchem.db.Importer.init(Importer.java:603)
at chemaxon.jchem.db.Importer.run(Importer.java:370)
Can anyone shed some light on what is happening when you set the TableName with schema? I have a table called "MOLECULES" that i am passing correct from a constant "TABLE".
This was working fine and all of a sudden i keop getting these errors.
Is there something wrong with my connectionhandler?
I extended it so I could serialize it:
import java.io.Serializable;
import java.sql.SQLException;
import chemaxon.util.ConnectionHandler;
public class JChemDataSource extends ConnectionHandler implements Serializable {
public JChemDataSource() {
super();
}
public JChemDataSource(String driver,String url,String loginName,String password) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
super();
System.out.println("Driver="+driver+" url="+url+" loginName="+loginName+" password="+password);
setDriver(driver);
setUrl(url);
setLoginName(loginName);
setPassword(password);
connect();
System.out.println("Initialized connection to structures database.");
}
}
Importer imp = new Importer();
imp.setConnectionHandler(getDataSource());
imp.setTableName(TABLE);
imp.setInput(file.getInputStream());
imp.setStoreImportedIDs(true);
System.out.println("Collecting file information ...");
imp.init();
I get the following error:
java.lang.NullPointerException
at chemaxon.jchem.db.TableInfo.getTableNameWithSchema(TableInfo.java:759)
at chemaxon.jchem.db.Importer.init(Importer.java:603)
at chemaxon.jchem.db.Importer.run(Importer.java:370)
Can anyone shed some light on what is happening when you set the TableName with schema? I have a table called "MOLECULES" that i am passing correct from a constant "TABLE".
This was working fine and all of a sudden i keop getting these errors.
Is there something wrong with my connectionhandler?
I extended it so I could serialize it:
import java.io.Serializable;
import java.sql.SQLException;
import chemaxon.util.ConnectionHandler;
public class JChemDataSource extends ConnectionHandler implements Serializable {
public JChemDataSource() {
super();
}
public JChemDataSource(String driver,String url,String loginName,String password) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
super();
System.out.println("Driver="+driver+" url="+url+" loginName="+loginName+" password="+password);
setDriver(driver);
setUrl(url);
setLoginName(loginName);
setPassword(password);
connect();
System.out.println("Initialized connection to structures database.");
}
}