
Inserting a new structure into the database

Specifying the criteria for structure search

In addition to the tools mentioned in the Developers' Guide, you also need a database server with both ODBC and JDBC capability. The ASP.NET sample JChem application has been extensively tested with Microsoft SQL Server, but it should work with most of the well known database servers (Oracle, DB2, MySql) as well. Depending on the ODBC specific features of the database, you may need to apply minor changes to the routines involving ODBC handling in the sample ASP.NET application.
The example can be used with a JChem structure table (created by JChemManager or via the JChem Java API).
In addition to the standard JChem table columns (cd_...),
the following columns must be present:
name of type VARCHARstock of type NUMERICcomments of type VARCHARNote that the word comments is reserved in many database servers, so you may have to enclose it in double quotes in SQL statements. Use the INTEGER datatype for the stock column when using Microsoft SQL Server.
You can test the JChem ASP.NET application with an empty JChem structure table containing the extra columns described above: use the insert function of the application to add structures in the table.
If you wish to test with a large dataset (for example to test speed and stability), you can either
Make sure that Internet Information Server is set up correctly for use with ASP.NET. This includes --in case of IIS 6.0-- setting the status of ASP.NET to "Allowed" in the Web Service extensions menu of the IIS Manager.
jchemregistrationTool.exe /n /SEin order to register JNBridge in the Standard Edition mode. (There is one registrationtool.exe in the 1.x-targeted and one in the 2.0-targeted directory. You have to pick the one corresponding to your .NET version.)
examples/ChemAxon.NET/ASP.NET/web.config file and change
the values, where necessary, to match your environment.
The tag configuration/jnbridge/dotNetToJavaConfig contains
information JNBridge needs in order to know how to channel calls made
to the JChem .NET proxies. You have to set the attributes of the
configuration/jnbridge/dotNetToJavaConfig tag as follows:
scheme: leave it sharedmem as is;
jvm: should point to the
bin\server\jvm.dll file in the JRE directory;
jnbcore: should point to jnbcore.jar
under the JNBridge installation directory;
bcel: should point to
bcel-5.1-jnbridge.jar under the JNBridge installation
directory;
classpath: should include a semicolon-separated list of the
directory path to the required Java libraries:jchem.jar in the lib directory of the
uncompressed JChem installation package;
dom4j.jar in the same directory as jchem.jar;
configuration/jnbridge/appSettings contains the
configuration for the JChem ASP.NET application proper. You have to set the
following key-value pairs with add attributes of the
configuration/jnbridge/appSettings element:
odbc.dsn: the ODBC data source name of the database containing
the test structure table;
jdbc.driver: the Java class name of the JDBC driver. Please,
consult the documentation of the JDBC driver documentation for information
on the appropriate value. You can find this information for the JDBC driver
of the best known databases here. Please, note
that the format of the JDBC configuration for Microsoft SQL Server 2005 is
different from that of earlier Microsoft SQL Server versions.
jdbc.url: the connection URL of the database as understood by
the JDBC driver. Please, consult the documentation of the JDBC driver
documentation for information on the appropriate value. You can find this
information for the JDBC driver of the best known databases here. Please, note
that the format of the JDBC configuration for Microsoft SQL Server 2005 is
different from that of earlier Microsoft SQL Server versions.
db.schema: the name of the schema containing the test
structure table;
db.username: the login name of the user which will be used to connect to the database.
db.password: the password of the user which will be used to connect to the database.
struct.table.name: the name of the test structure table.
bin directory of
your JChem installation
jchem5.1.2_JnbProxies_1.1.dll or
jchem5.1.2_JnbProxies_2.0.dll depending on the version of your
.NET runtime. You can download
them from our website.
JNBShare.dll and JNBSharedMem.dll are both
part of the standard JNBridge package. The directories
1.x-targeted and 2.0-targeted in the JNBridge
package contain different versions of these files targeting different
versions of the .NET runtime. Use those files located in the directory
matching the version of your .NET runtime.
init.bat batch file in the
examples/ChemAxon.NET directory and modify the values
of the PROCESSOR_TYPE environment variable to match
your environment.
sdkvars.bat batch file located in the
Bin directory of your .NET SDK installation to
set the required environment variables.
examples/ChemAxon.NET/ASP.NET directory.
build.bat batch file to compile the .NET
assembly containing the supporting routines for the JChem
ASP.NET example application.
http://<hostname>:<port>/jchem/examples/ChemAxon.NET/ASP.NET/index.aspx. The
WEB page at this URL will contain the necessary menus to insert, update and
search in the test table.