Getting Started Using the Design API
The topic presents a simple example to help you start using the Design API. The example shows how you can use the Design API package to compile and run a Java class that returns the connection information from a catalog file.
- Compile the sample code TellMeConnection.java in
<install_root>\help\samples\APICatalog
(make sure that the path of the file JREngine.jar is before that of the file report.jar).javac -classpath <install_root>\lib\JREngine.jar;<install_root>\lib\sac-1.3.jar;<install_root>\lib\report.jar TellMeConnection.java
- Set the license key for Design API using the method dr.setUserInfo("UID","XXXXXXXXXXX") in TellMeConnection.java.
- Run the sample code.
java -classpath ".;<install_root>\lib\JREngine.jar;<install_root>\lib\report.jar;<install_root>\lib\sac-1.3.jar;<install_root>\lib\log4j-core-2.13.3.jar;<install_root>\lib\log4j-api-2.13.3.jar" -Dreporthome=<install_root> TellMeConnection –path=<catalog path> -catalog=<catalog name>
For example,
java -classpath "C:\LogiReport\Designer\lib\JREngine.jar;C:\LogiReport\Designer\lib\report.jar;C:\LogiReport\Designer\lib\sac-1.3.jar;C:\LogiReport\Designer\lib\log4j-core-2.13.3.jar;C:\LogiReport\Designer\lib\log4j-api-2.13.3.jar;C:\LogiReport\Designer\lib\hsqldb-2.5.1.jar" -Dreporthome=C:\LogiReport\Designer TellMeConnection -path=C:\LogiReport\Designer\Demo\Reports\TutorialReports -catalog=JinfonetGourmetJava.cat
And the output should be:
Name: Jinfonet demo
Driver: org.hsqldb.jdbcDriver
URL:jdbc:hsqldb:C:\LogiReport\Designer\Demo\db\DemoDB
User: sa
Password
TimestampFormat: yyyy-MM-dd HH:mm:ss.SSS
TimeFormat: HH:mm:ss
DateFormat: yyyy-MM-dd
ExtraNamePattern: Default(JDBC)