2. Introduction to development with JChem Base

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.

Software Requirements

In order to develop applications using JChem Class Library the following software need to be installed:

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.)

.NET support

All of ChemAxon's API can be integrated into .NET environments through use of JNBridge. JNBridge is a third-party tool which translates any Java APIs to .NET API so that Java libraries can be used from within .NET.

Please see the links below and in the left hand navigation for documentation and implementation examples.

JChem Base features and architecture

The following table summarizes the technical details of JChem Base:

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.
  • Most database engines (like Oracle, MySQL, MSSQL Server, MS Access, DB2, PostgreSQL etc...) can be used to store structures.
  • Structural and other chemical or non-chemical data can be handled together.
  • Tables can be joined.
  • SQL statements can access structural data.
Java modules are supplied for chemical structure searching.
  • Fast and reliable search that can be built into custom systems.
  • Web access to structure querying. Structure search and data manipulation can be handled by Java servlets and scripts that access Java classes or JavaBeans, like JSP (Java Server Pages).
  • Structure search can be built into legacy databases.
Structure input/update/display by the Marvin Java Applets and JavaBeans. Convenient and interactive user interfaces for
  • Java capable web browsers (recently all are)
  • standalone Java applications
Java application for table creation and SDF/Molfile/SMILES import/export. Communication with other chemical applications.

Architecture: A typical interaction between a client and the database

  1. Using a web browser, the user enters a structure into MarvinSketch.
  2. A custom script (or servlet) for substructure/similarity searching is activated, which
    • Connects to a database through JDBC.
    • Searches in a table containing structures.
    • Creates a list containing the ID numbers of found structures
  3. The script retrieves mixed structural and non-structural data by SQL SELECT statements, using the list of hits and tables or views in the database.
  4. The script creates the page that displays the retrieved data in the client's browser using MarvinView.
  5. The user manipulates the data ...

model

Please note that there are other possibilities for invoking substructure searching, which might better suit your demands.

Initializing the Database for Structure Handling

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:

See the documentation of JChemManager for more details.

What is Useful to Be Familiar With Before Starting the Development

Development of Graphical User Interfaces for JChem Applications

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.

Accessing Structure Tables

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

JChem's classes expect the following parameters:

Though structure tables can be manipulated without using JChem's classes, you must be careful not to harm the integrity of the database. Only custom data fields of jchem tables are allowed to be manipulated directly by SQL statements - otherwise the JChem API must be used.

Java examples for creating database tables using JChem API are available in Java and HTML format.

Demo applications

It is suggested to setup and try one of the demos included in the JChem package before starting the development of a custom application powered by JChem.

Connecting to Databases

Java classes in JChem may use ConnectionHandler or the java.sql.Connection class passed as a parameter to connect to a database.

Examples for opening a connection using ConnectionHandler

If parameters of the connection are saved in JChemManager then they can be reused from code.