Changes

Jump to navigation Jump to search
1,210 bytes added ,  15:07, 6 December 2010
Created page with "<p>In the standard mode, a database command can be sent to the server using the <code>execute()</code> function of the <code>Session</code>. This functions returns the whole resu..."
<p>In the standard mode, a database command can be
sent to the server using the <code>execute()</code> function
of the <code>Session</code>. This functions returns the whole
result. With the <code>info()</code> function, you can request some
information on your executed process. If an error occurs, an
exception with the error message will be thrown.</p>

<h2>Usage</h2>

<p>The standard execution works as follows:</p>

<ol start="1">
<li>Create a new session instance with hostname, port, username and password.</li>
<li>Call the <code>execute()</code> function of the session with the <a href="commands">database command</a> as argument.</li>
<li>Receive the result of a successfully executed command. As an error occurs an exception is thrown.</li>
<li>Continue using the client (back to 2.), or close the session.</li>
</ol>

<h2>Example</h2>

<ol start="1">
<li>Create a session object:<br/>
<code>Session session = new Session("localhost", 1984, "admin", "admin")</code></li>
<li>Run the command in question and print the textual result:<br/>
<code>print session.execute("info database")</code></li>
<li>Close the session:<br/>
<code>session.close()</code></li>
</ol>
bueraucrat, Bureaucrats, editor, reviewer, Administrators
907

edits

Navigation menu