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