Connecting to an existing IJC schema

    If another user has already set up an Instant JChem database in Oracle, MySQL or PostgresSQL then you may need to connect to this database and use it. There are two ways in which this can be done:

    1. Manually make the connection by entering all the connection details

    1. Automatically connect using pre-configured settings provided by an administrator

    > {primary}
    > To connect to any remote database in IJC you must have an IJC license key. To purchase a license key, please email:
    >
    > [sales@chemaxon.com](mailto:sales@chemaxon.com)
    >

    To enter a license see Adding Instant JChem Licenses .

    To manually connect to an existing IJC database Schema

    To do this you will need the following information:

    • The type of database (e.g. Oracle, MySQL or PostgreSQL )

    • The URL of the database

    • The username and password to connect to the database

    • Your Instant JChem username and password

      You may need to obtain this information from the administrator who set up the database.

    In the Projects window , right-click the selected project and choose Connect to Schema. The Connect to Schema wizard opens to guide you through the process:

    Step 1. Choose Template:

    • Select the appropriate template for your database type.

    • Click Next.

      images/download/attachments/1804854/image2019-7-3_15-56-12.png

      Step 2. Database Connection:

    The details in this step differ slightly depending on the type of database you are connecting to.

    • Enter the database URL, username and password.

    • Specify whether you wish to have the database password stored.

      {primary} Note:

      This password will be stored in a file on your computer.

    • Enter any extra details that might be needed for your database type (e.g. the name of the database schema for Oracle).

    • Click Next.

      {primary} Note about database schemas:

      Currently IJC only supports use of the default schema name for the database user in Oracle (e.g the username in uppercase). MySQL does not support schemas so this property is not present for MySQL databases. The term 'schema' used here is distinct from an IJC Schema which represents the contents of a database you are connected to.

      images/download/attachments/1804854/image2019-7-3_15-58-12.png

    Step 3. Pick Up Schema:

    Select a schema from the provided list and click Finish. This screen lists the IJC schemas that are found in the database. There will probably be only one. The schema is added to your project and a corresponding schema node (images/download/attachments/1804949/ConnectionRemote.gif) displays under the given project in the Projects window. You can then connect to it using your IJC username and password as usual.

    images/download/attachments/1804854/image2019-7-3_16-1-44.png

    To automatically connect to an existing IJC database schema using pre-configured settings:

    This method allows an administrator to define all the settings and provide them to you at a location defined by a URL. This is very similar to entering (or pasting in) an URL into your web browser. The wizard used to do this is the same as the manual connection, but the process is significantly simplified as you only need to provide one piece of information, the URL.

    {primary} Note:

    If the connection details have been encrypted with a password then you will need this password to be able to use them. Ask your database administrator for this.

    In the Projects window , right-click the selected project and choose Connect to Schema. The Connect to Schema wizard opens to guide you through the process:

    Step 1. Choose Template:

    • Select the 'Prepared configuration' template.

    • Click Next.

    Step 2. Configuration location:

    • Enter the URL given to you by your administrator.

    • You can optionally click on the 'Verify' button to read and show the details.

    • Click Next.

    Step 3. Configuration location:

    The specified schema should be selected. Click 'Finish' to close the wizard and the schema should now be added to your project. You can now connect to this as usual using the username and password that your administrator gave you.

    Information for administrators about providing pre-configured schema information:

    You will need:

    • An IJC schema in an Oracle or MySQL database.

    • A web server onto which you can place the configuration file (alternatively you can use the file:// protocol if you prefer to use a location on a file server.

    To do this:

    1. Find the appropriate connection details file for your schema in IJC. This will be located in the .config directory within your IJC project directory and will have a .ijs file extension.

    1. Take a copy of this file.

    1. Edit the file as appropriate (see below).

    1. Place the file on your web server in the appropriate location.

    1. Notify your users of this URL, and of their IJC username and password (and the password used to encrypt the data if this is used).

    About the configuration file:

    The configuration file is an extension of the .ijs XML file that is used by IJC to store the connection details for an IJC schema. Two extra elements can be present:

    connection.description This can be used to provide a user friendly name for the description.

    registration.code.ijc This can be used to provide the IJC license key and avoids the need for users to enter this manually. If a license key is already present in IJC this element is ignored.

    All other elements from the .ijs file are needed and typically will not need changing. An example file looks like this:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
    <properties>
    <comment>Connection config. Do not edit.</comment>
    <entry key="connection.description">Connection to corporate MySQL database</entry>
    <entry key="registration.code.ijc">ijc-license-key-goes-here</entry>
    <entry key="database.driver">com.mysql.jdbc.Driver</entry>
    <entry key="schema.id">EAF6AA3A1733890394F18ED5ECD93334</entry>
    <entry key="database.url">jdbc:mysql://localhost/ijc</entry>
    <entry key="showoptions.ijc.username">ALWAYS</entry>
    <entry key="showoptions.db.username">DEFAULT</entry>
    <entry key="database.username">dbuser</entry>
    <entry key="database.password">secret</entry>
    <entry key="schema.name">mysql</entry>
    </properties>

    {primary} Note:

    When the connection configuration file (the .ijs) is created there is an option to encrypt the connection details. If this has been performed the contents of the file will look different. You will need to provide your users with this pasword for them to be able to decrypt the details. This approach avoids the users need to know the database connection details or of being able to read these from the configuration file. It provides a limited layer of security, hiding connection details from the users.