These classes provide solutions for importing/exporting structures into/from JChem database tables.
Structure files can be imported into the database using chemaxon.jchem.db.importer.
Java example:
Note: For the sake of readability, try/catch is omitted in this example.
You may also use InputStream instead of File in the constructor of Importer. The only possible drawback may be that a given number of lines (linesToCheck
parameter in the example) will be buffered in memory in that case, so this value shouldn't be excessively high.
With the use of chemaxon.jchem.db.exporter, structure table data can be exported into files or any OutputStream objects.
Java example:
Molecules can be written one-by-one, by changing the end of the code to the following:
Note: For the sake of readability, try/catch is omitted in this example.
Use Exporter.setSelectStatement() to specify a custom select statement as the basis of the export. This enables
exporting related data from other tables together with the structures
ordering the structures with an ORDER BY clause