Search code examples
jdbcjarcode-generationtelosys

How to set the JDBC driver JAR in Telosys CLI to create a dbmodel


I use Telosys Eclipse Plugin regularly to generate my Java code from a “dbmodel” built from a PostgreSQL database. In Eclipse with a Java Project the JDBC driver is already in the Java Build Path so it’s very easy to create the “dbmodel”.

Now I’m trying to use Telosys CLI (instead of the Eclipse Plugin) to generate JavaScript code for NodeJS. I’d like to create a new “dbmodel” from another PostgreSQL database, the question is: with Telosys CLI how can I specify the JDBC driver (jar file) that must be used to create this new “dbmodel”?


Solution

  • When your project is not a Java project you just have to put the JDBC driver jar file in the "lib" directory of the "TelosysTools" folder. Once you have do that you can reference the driver in the "databases.dcfg" file (as usual) and Telosys will find it.

    For example : "TelosysTools/lib/derbyclient.jar"

    In Telosys-CLI this is the only way to use a JDBC driver to create a "dbmodel"

    In the Eclipse plugin you can also use the "lib" folder if the jar is not defined in the "Java Build Path"