Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 <p> | |
2 | |
3 Connection to an LTPDA Repository is normally carried out as part of other processes. For example, when submitting an | |
4 object to the repository using the <tt>submit</tt> command, the user is prompted to login to the chosen repository. | |
5 </p> | |
6 <p> | |
7 It is also possible to connect to a repository using a script interface. The result is a connection object which can | |
8 be passed to other methods (for example, <tt>submit</tt>), thus allowing the construction of more automated procedures | |
9 for interacting with repositories. | |
10 </p> | |
11 <p> | |
12 To connect to a repository using the script interface, us the command <tt>utils.jmysql.connect</tt>. It takes the following input arguments: | |
13 | |
14 <table border="1" cellpadding="2" width="30%" bgcolor="#DDDDDD"> | |
15 <tr valign="top"> | |
16 <td><tt>hostname</tt></td><td>A hostname for the repository</td> | |
17 </tr> | |
18 <tr valign="top"> | |
19 <td><tt>dbname</tt></td><td>A database name to connect to</td> | |
20 </tr> | |
21 <tr valign="top"> | |
22 <td><tt>username</tt></td><td>[optional] A username to connect with</td> | |
23 </tr> | |
24 <tr valign="top"> | |
25 <td><tt>username</tt></td><td>[optional] A password to connect with</td> | |
26 </tr> | |
27 </table> | |
28 | |
29 <br> If you don't supply them as input arguments, you will then be prompted for a | |
30 valid username and password. | |
31 <br> | |
32 The result is a <tt>mpipeline.repository.RepositoryConnection</tt> object which can be further used to interact with the repository. | |
33 <br> | |
34 To disconnect from the server, use the <tt>closeConnection</tt> method of the <tt>mpipeline.repository.RepositoryConnection</tt> class: | |
35 | |
36 <div class="fragment"><pre> | |
37 >> conn.closeConnection | |
38 </pre></div> | |
39 | |
40 </p> | |
41 | |
42 |