Connecting to an LTPDA Repository


Connection to an LTPDA Repository is normally carried out as part of other processes. For example, when submitting an object to the repository using the submit command, the user is prompted to login to the chosen repository.

It is also possible to connect to a repository using a script interface. The result is a connection object which can be passed to other methods (for example, submit), thus allowing the construction of more automated procedures for interacting with repositories.

To connect to a repository using the script interface, us the command utils.jmysql.connect. It takes the following input arguments:

hostnameA hostname for the repository
dbnameA database name to connect to
username[optional] A username to connect with
username[optional] A password to connect with

If you don't supply them as input arguments, you will then be prompted for a valid username and password.
The result is a mpipeline.repository.RepositoryConnection object which can be further used to interact with the repository.
To disconnect from the server, use the closeConnection method of the mpipeline.repository.RepositoryConnection class:
	>> conn.closeConnection




©LTP Team