JChem Class Library is a collection of Java classes, which provides the functionality of handling JChem structure tables in relational database management systems (RDBMS-s) for Java applications.
In order to develop applications using JChem Class Library the following software need to be installed:
If your application will contain servlets or JSP scripts, a combination of a web server and a servlet server are needed. A few example of such systems:
If you are going to develop an ASP application, then Microsoft's Internet Information Server is needed to be set up. ASP scripts can access JChem through a .NET bridge.
The JChem package contains
examples for JSP and ASP applications.
To let Java applications use the
JChem Class Library,
set classpath to include
<JChem home>/lib/jchem.jar.
See the jcman
batch file or shell script in the jchem/bin
directory as examples for setting classpath.
(See the warning to avoid problems.)
If you are developing a web application (running servlets and/or JSP),
see the documentation of your servlet engine for details on
setting classpath for servlets.
(Click here
for Tomcat instructions.)
Please see the links below and in the left hand navigation for documentation and implementation examples.
Technical details |
Resulting features |
| The system is built in Java | Portable and high performance |
| It uses JDBC technology to store and retrieve structures in relational databases. |
|
| Java modules are supplied for chemical structure searching. |
|
| Structure input/update/display by the Marvin Java Applets and JavaBeans. | Convenient and interactive user interfaces for
|
| Java application for table creation and SDF/Molfile/SMILES import/export. | Communication with other chemical applications. |

Please note that there are other possibilities for invoking substructure searching, which might better suit your demands.
Before starting the development of a system that uses JChem to access structure tables in RDBMS-s, run JChemManager to initialize the database for structure handling:
JChemProperties table automatically
by invoking JChemManager the first time.
This table stores information on the database and the
structure tables.
To support drawing and displaying chemical structures in standalone, rich-client or Java Web Start applications, JChem is bundled with MarvinBeans.
Marvin applets are recommended for applying in the interface of chemical web applications. Development issues and examples of using these tools are available in the Marvin Developer's Guide. However, you can also apply other chemical GUIs that import and export structure file formats recognized by JChem.
Structure tables used by JChem reside in databases of RDBMS-s. See the administration guide for more details on managing these tables.
To access a structure table, a JDBC connection has to be built between the application and database. The tables can be handled by
java.sql.Statement), or
JChem's classes expect the following parameters:
java.sql.Connection object, usually contained
in a
ConnectionHandler object.
cduser.structures). If you are unsure about the name,
check the content of the JChemProperties table in the database.
Java examples for creating database tables using JChem API are available in Java and HTML format.
ConnectionHandler or the
java.sql.Connection class
passed as a parameter to connect to a database.
Examples for opening a connection using
ConnectionHandler
ConnectionHandler conHandler = new ConnectionHandler();
conHandler.setUrl(url);
conHandler.setDriver(driver);
conHandler.setPropertyTable(propTableName);
conHandler.setLoginName(userName);
conHandler.setPassword(password);
try {
conHandler.connect();
} catch ...
<jsp:useBean id="conHandler" scope="session"
class="chemaxon.util.ConnectionHandler" />
<%
if(!conHandler.isConnected()) {
%>
<jsp:setProperty name="conHandler" property="url"
value="<%= url %>" />
<jsp:setProperty name="conHandler" property="driver"
value="<%= driver %>" />
<jsp:setProperty name="conHandler" property="propertyTable"
value="<%= propTableName %>" />
<jsp:setProperty name="conHandler" property="loginName"
value="<%= username %>" />
<jsp:setProperty name="conHandler" property="password"
value="<%= password %>" />
<jsp:setProperty name="conHandler" property="connected"
value="<%= true %>" />
<%
}
%>
var conHandler=Session("conHandler");
if(conHandler==null) {
conHandler = Server.CreateObject("ChemAxon_ConnectionHandler.Bean");
Session("conHandler") = conHandler;
}
if(!conHandler.connected) {
// setting conHandler
conHandler.url = url;
conHandler.driver = driver;
conHandler.propertyTable = propertyTableName;
conHandler.loginName = username;
conHandler.password = password;
// Attempting to connect to the database
conHandler.connect_NE();
}
if(conHandler.error!=0) {
...
}
If parameters of the connection are saved in JChemManager then they can be reused from code.
ConnectionHandler ch = new ConnectionHandler();
Properties props = new SettingsHandler().getSettings();
if (!ch.loadValuesFromProperties(props)) {
throw new IOException("Insufficient connection data.");
try {
ch.connect();
} catch ...
Java examples are available in Java and HTML format.