Difference between revisions of "JavaQM-API"
Jump to navigation
Jump to search
(created) |
(added download preview) |
||
Line 5: | Line 5: | ||
==Features== | ==Features== | ||
Currently the API supports almost all of the Documented QMClient commands. Access to them is controlled by the main class QMConnection. | Currently the API supports almost all of the Documented QMClient commands. Access to them is controlled by the main class QMConnection. | ||
+ | |||
+ | ==Download== | ||
+ | For now, until we comb the code and put the LGPL into effect for the source a prevew Binary download is avaliable here: [http://www.scarletdme.org/downloads/JavaQMConnect-Preview.jar JavaQMConnect-Preview.jar] | ||
==Example== | ==Example== | ||
− | Here is an example of how to use the JavaQM API Lib | + | Here is an example of how to use the JavaQM API Lib. Simply place the Jar in the library path or same directory as your classes or Jar file. |
<pre> | <pre> |
Revision as of 16:01, 19 August 2009
This Java API library is a native Java library, which allows you to access QM via the QMClient network interface.
All you need is QMClient running on the server, the IP address, a valid username and password and the Account you want to access.
Features
Currently the API supports almost all of the Documented QMClient commands. Access to them is controlled by the main class QMConnection.
Download
For now, until we comb the code and put the LGPL into effect for the source a prevew Binary download is avaliable here: JavaQMConnect-Preview.jar
Example
Here is an example of how to use the JavaQM API Lib. Simply place the Jar in the library path or same directory as your classes or Jar file.
import com.openqm.qmconnect.*; /** Example program that accesses QM with the Java API */ public class Example { Example() { try { /* Initialise the connection */ QmConnection connection = QmConnection.create("localhost",4243); /* Tell it to log in */ connection.connect("testuser", "password", "QMSYS"); /* Open Up the VOC file as an example */ QmFile vocFile = connection.open("VOC"); /* Read from the Opened VOC file */ String record = connection.read(vocFile, "MESSAGES"); System.out.println("This is the MESSAGES Record from the VOC file: " + record); } catch (QMException e) { System.err.println("Error occurred connecting to QM"); } } }