JChemSearch , ConnectionHandler object , Driver

User 6346ce4be1

30-03-2016 07:53:49

Hello


I`m run groovy scripts from Instant JChem.
I use MySQL database.

I tried to do an overlap analysis through JChemSearch class object. It needs a ConnectionHandler.
I am connected to database and get parameters from schema.databasePlatform.dataSource.

I create new Connection object, but It cannot find Driver for my database.

Is JChemSearch needs a new ConnetionHandler? Is there posibility to access to current ConnetionHandler?

Please help



ChemAxon 26d92e5dcd

30-03-2016 08:12:41

Dear Rafal,


would not it be easier to do the overlap analysis with integrated tools in IJC? (documentation)


Regarding the database connection. Did you refer to the documentation here? I would suggest this approach from Instant JChem, instead of relying on getConnection() and getConnectionHandler() from JChemSearch object and 


Wishing all the best


David

User 6346ce4be1

30-03-2016 08:31:27

Thank you for reply

I would like to use script, because in opinion of others it is more "comfortable" (clicking two or three times and an output file is created)

I tried this approach:
https://docs.chemaxon.com/display/jchembase/Structure+Searching#StructureSearching-duplicate />Here is my Nemesis: 
    searcher.setConnectionHandler(connHandler);

I tried: Connection con = this.dataSource.getConnection() (class as in post above)
But ConnectionHandler (https://www.chemaxon.com/jchem/doc/dev/java/api/chemaxon/util/ConnectionHandler.html)
throws an exception:
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: chemaxon.util.ConnectionHandler(com.im.commons.db.datasource.BaseDataSource$ConnectionWrapper)

(ConnectionWrapper inherited from Connetion object)

Best regards