JChem Base FAQ
Installation and configuration
- How to upgrade to a new JChem version?
- JCMAN GUI does not work via X between Linux (server) and Windows (client)
- How should I set the "JDBC driver" and "URL of database" fields for starting JChemManager?
- Why do I get SQLException or other error when I use JChemManager?
- I get exception when I start JChemManager using Oracle's JDBC thin driver.
Performance
Integration
- How can I use the JChem API from my favorite programming language (C++, C#, PHP, Python, Javascript, Perl)?
- How can I use the JChem tools as a web service?
Examples
- Where can I find examples for using JChem?
- How should I set the connection string in the case of ASP example or other ADO capable environment?
- Copy/paste doesn't work with a certain Look and Feel.
Common issues
- I get the following exception using MySQL: com.mysql.jdbc.PacketTooBigException: Packet for query is too large
- For some structures the database field "cd_smiles" is null. Why?
- I get the following error message : "The structure table contains obsolete data. Please regenerate the table." What does it mean ?
Installation and configuration
- How to upgrade to a new JChem version?
These are the steps that you should follow at upgrading:
- Download the latest JChem installation package
- Make sure no JChem applications are running
- Replace your old JChem directory with the contents of the new package. (delete/move the old directory and extract the package to the same location)
- Run the JChemManager (jcman) GUI, or execute the following command to
update in text mode:
jcman u
- The application will automatically prompt you for the upgrades. Some of these changes are quick, however the regeneration of the tables can take for a while. The time requirement for table regeneration is comparable to the time of importing the same number of structures.
- If you are using JChem from other (standalone or web) applications,
make sure you also update the .jar files used by them.
These jar files are located under the jchem\lib directory in the unpacked
package. You should also restart these applications, so they can load the
new code from the updated .jar files
For example if you are running a JSP application in Tomcat:
- Stop Tomcat
- Update the .jar files in Tomcat's lib directory.
- Clearing Tomcat's cache is also recommended. This can be performed by deleting the content of <tomcat_home>/work directory.
- Start Tomcat
-
JCMAN GUI does not work via X between Linux
(server) and Windows (client)
It is possible that JCMAN GUI does not work on Linux server with Windows client via X sever in some cases. Opening your ssh connection with -Y option may solve the problem.
Related forum topic: http://www.chemaxon.com/forum/viewtopic.php?p=15322#15322
-
How should I set the "JDBC driver"
and "URL of database" fields for starting JChemManager?
One can find simple examples of JDBC URL and driver strings in the table below.
(For more complex cases please see the documentation of the JDBC driver.)
Notes:- ODBC connection is only tested and supported for Microsoft Access. For other databases the native JDBC drivers should be used.
- For Oracle only the "thin" driver is tested and recommended ("oci" connection is not supported).
Database JDBC driver URL format Example Oracle
oracle.jdbc.OracleDriver
jdbc:oracle:thin:@[host address]:[port]:[database sid]
jdbc:oracle:thin:@localhost:1521:mydb
MySQL
com.mysql.jdbc.Driver
jdbc:mysql://[host]/[database][?options]
jdbc:mysql://localhost/mydb?useCursorFetch=true&defaultFetchSize=1000
MS Access via ODBC
sun.jdbc.odbc.JdbcOdbcDriver
jdbc:odbc:[odbc data source]
jdbc:odbc:mydatasource
PostgreSQL
org.postgresql.Driver
jdbc:postgresql://[host]:[port]/[database]
jdbc:postgresql://localhost:5432/mydb
DB2
COM.ibm.db2.jdbc.net.DB2Driver
jdbc:db2://[host]/[database]
jdbc:db2://localhost/mydb
InterBase
interbase.interclient.Driver
jdbc:interbase:[path to interbase data file i.e. the .gdb file]
jdbc:interbase://localhost/c:/interbase/interbasedb.gdb
MS SQLServer
com.microsoft.jdbc.sqlserver.SQLServerDriver
jdbc:microsoft:sqlserver://[host]:[port];DatabaseName=[database];SelectMethod=cursor
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor
MS SQLServer 2005
com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:sqlserver://[host]:[port];databaseName=[database];SelectMethod=cursor
jdbc:sqlserver://localhost:1433;databaseName=mydb;SelectMethod=cursor
HSQLDB / HXSQL
org.hsqldb.jdbcDriver
jdbc:hsqldb:hsql://[host]/[database]
jdbc:hsqldb:hsql://localhost/
Derby
org.apache.derby.jdbc.EmbeddedDriver
jdbc:derby:[subsubprotocol:][path/][database];create=true
jdbc:derby:/my/path/mydb;create=true
Composite
cs.jdbc.driver.CompositeDriver
jdbc:compositesw:dbapi@[Host]:[Port]?domain=[Domain name]&dataSource=[Data Source Name]"
jdbc:compositesw:dbapi@10.0.0.100:9401?domain=composite&dataSource=virtualdb"
-
Why do I get SQLException or
other error when I use JChemManager?
The most probable causes:
- Incorrect URL to the database (it may occur during login)
- Inappropriate username / password (it may occur during login)
- Faulty JDBC or ODBC driver. Try a different one.
-
I get exception when I start
JChemManager using Oracle's JDBC thin driver.
Make sure that the URL is appropriate (e.g: jdbc:oracle:thin:@myhost:1521:mySID). Check if all needed services run (the listener service is necessary).
- How to upgrade to a new JChem version?
Integration
-
How can I use the JChem API from my
favorite programming language (C++, C#, .NET, Python, Javascript, Perl)?
For users of the .NET API, the JChem API can be integrated into .NET applications by the .NET Packages.
Other web service compatible languages (including C++ and C#) can use JChem Web Services. -
How can I use the JChem tools as a web service?
Many of the JChem tools are available as web services. See the JChem Web Services Server for more information
-
How can I use the JChem API from my
favorite programming language (C++, C#, .NET, Python, Javascript, Perl)?
Examples
- Where can I find examples for
using JChem?
- A JSP (Java Server Pages) and ASP examples can be found in
the examples directory. Please see
<jchem dir>/examples/index.htmlfor a description.
- A JSP (Java Server Pages) and ASP examples can be found in
the examples directory. Please see
-
How should I set the connection
string in the case of ASP or other ADO capable environment?
If you would like to call SQL statements using ADO, you may choose between ODBC and OLEDB connections. (ADO can not contact to the databases through JDBC drivers.)
- Example for an ODBC connection
var adoConnectionString=
"DSN="+MyDSN+";"+
"UID="+username+";"+
"PWD="+password;
- Example for an OLEDB connection to Oracle
var adoConnectionString=
"Provider=MSDAORA.1;"+
"Data Source="+myServiceName+";"+
"User ID="+username+";"+
"Password="+password;
In the case of Oracle, if an error occurs, please see HOWTO: Troubleshoot an ASP-to-Oracle Connectivity Problem - Example for an ODBC connection
-
Copy/paste doesn't work with a
certain Look and Feel.
Keyboard shortcuts for Copy/Paste/Cut functions may vary by Look and Feel. For example in the case of Windows Look and Feel these are
CTRL+C,CTRL+V, andCTRL+X, respectively. In the case of Motif LF the shortcuts for the same commands are:CTRL+INS,SHIFT+INS, andSHIFT+DEL.
- Where can I find examples for
using JChem?
Common issues
-
I get the following exception using MySQL:
com.mysql.jdbc.PacketTooBigException: Packet for query is too large
Please increase the value of the "max_allowed_packet" variable for MySQL. The following line should be added to the configuration file "my.ini" under the [mysqld] section :
max_allowed_packet = 100M -
For some structures the
database field "cd_smiles" is
null. Why?
JChem works with the standardized form of imported structures stored in ChemAxon Extended SMILES format. This extended format can represent a wider range of structures than SMILES, but there are still some cases, when this format is not applicable. In these cases the "cd_smiles" field is null, and JChem uses the "cd_structure" field for these rows. (The "cd_structure" represents the structures in the original input format)
Currently the cd_smiles is null in the following cases:
- Structure contains radicals
- Structure contains R-groups
- the SMILES would be too long for the database field (very large molecules).
In these cases the search is slower, since the target structures have to be standardized on the fly.
Note: For most databases the size of the "cd_smiles" field can be increased at the table creation dialog (in the SQL text). The increased length is automatically utilized. This can speed up the search if a high percentage of the structures are huge. -
I get the following error message :
"The structure table contains obsolete data. Please regenerate the table."
What does it mean ?
Sometimes there are some changes in the data structure of JChem, which are incompatible with earlier versions. To obtain correct search result, the regeneration of the old structure tables is necessary. For more information and instructions please see the administration guide.
-
I get the following exception using MySQL:
com.mysql.jdbc.PacketTooBigException: Packet for query is too large
If your question is not answered, please check out our forum or .
Do you have a question? Would you like to learn more? Please browse among the related topics on our support forum or search the website. If you want to suggest modifications or improvements to our documentation email our support directly!
