Mercurial > hg > ltpda
view m-toolbox/html_help/help/ug/repo_connect_content.html @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line source
<p> 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 <tt>submit</tt> command, the user is prompted to login to the chosen repository. </p> <p> 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, <tt>submit</tt>), thus allowing the construction of more automated procedures for interacting with repositories. </p> <p> To connect to a repository using the script interface, us the command <tt>utils.jmysql.connect</tt>. It takes the following input arguments: <table border="1" cellpadding="2" width="30%" bgcolor="#DDDDDD"> <tr valign="top"> <td><tt>hostname</tt></td><td>A hostname for the repository</td> </tr> <tr valign="top"> <td><tt>dbname</tt></td><td>A database name to connect to</td> </tr> <tr valign="top"> <td><tt>username</tt></td><td>[optional] A username to connect with</td> </tr> <tr valign="top"> <td><tt>username</tt></td><td>[optional] A password to connect with</td> </tr> </table> <br> If you don't supply them as input arguments, you will then be prompted for a valid username and password. <br> The result is a <tt>mpipeline.repository.RepositoryConnection</tt> object which can be further used to interact with the repository. <br> To disconnect from the server, use the <tt>closeConnection</tt> method of the <tt>mpipeline.repository.RepositoryConnection</tt> class: <div class="fragment"><pre> >> conn.closeConnection </pre></div> </p>