In this article, Assad shows how to configure Convertigo in order to install additional JDBC drivers and configure those drivers through JNDI or directly from JDBC



 
Convertigo Mobility Platforms comes with several JDBC drivers already configured such as Oracle, MySQL or IBM DB2. However, it is possible to add any JDBC driver. Although it may not have been qualified by our team, Convertigo gives you all the flexibility to use any driver. There are several steps in order to add a new JDBC driver to Convertigo configuration.

JNDI Configuration

First, you have to download the JDBC driver and copy the .jar file in :
your studio installationfolder\plugins\com.twinsoft.convertigo.studio_x.y.z.vxxxxx\tomcat\webapps\convertigo\WEB-INF\lib

Then, we will edit the context.xml file in the folder

your studio workspace folder\.metadata\.plugins\com.twinsoft.convertigo.studio\studio

<?xml version=”1.0″ encoding=”UTF-8″?>

<Context>

<Resource name="jdbc/keyring"
auth="Container"
type="javax.sql.DataSource"
username="postgres"
maxActive="1"
password="pwd"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://175.12.29.36:5432/keyring"/>

</Context>

In our sample, our database name is keyring and is located on the server at the address 175.12.29.36 listening on the port 5432. We finally need to edit our JNDI in the studio with our parameters and we are done.
Please note that the “DataBase URL” field in the studio refers to the Resource name configured in your context.xml file. In our case, it is “jdbc/keyring”.

Warning!!. Note that you cannnot use the “test connection” button for JNDI data sources as these sources are managed directly by Tomcat

jndi

Server configuration

The same logic as above apply on the server, there is just a slight change in the location of the files. The .jar file should be installed in the folder your server installation folder\Convertigo Enterprise Mobility Server\tomcat\lib

The context.xml file for jndi configuration is located in the folder your server installation folder\Convertigo Enterprise Mobility Server\tomcat\conf

Classic JDBC configuration

This is to add the driver as a standard JDBC driver in the studio and the server without using JNDI

  • Copy the JAR file to the same locations (Studio and Server) that for JNDI
  • For the Studio, edit the installed_path_\plugins\com.twinsoft.convertigo.studio_7.x.x.vyyyyy\tomcat\webapps\convertigo\WEB-INF\classes\jdbc_drivers.properties
  • Add a line such as <NN>=<dbc_driver_class>,<jdbc_sample__url> for example 10=org.postgresql.Driver,jdbc:postgresql://<database ip adress>:<port>/<database_name>

You will have a new line in the SQL connector drivers combobox to select the new driver you added. Use it and configure the correct JDBC url to connect to your database.

Conclusion

In conclusion, we see that Convertigo Mobility Platform is open to customization and lets you configure it in many ways although it is provided with many installed functionalities.
We hope you enjoyed this article and see you on the forum to share with us your feedbacks.

Leave a comment