Changes

Jump to navigation Jump to search
106 bytes removed ,  13:18, 10 January 2011
#Close the query with <code>close()</code>.
==Python Example==
<pre class="brush:javapython">// Create a session objectSession session = new Session("localhost"import BaseXClient, 1984, "admin", "admin");time
// Define a query and create a query objecttry:String q = "declare variable $name external; for $i in 1 to 10 return element { $name } { $i }"; # initialize timerQuery query start = sessiontime.queryclock(q);
// Call the bind method of your query object # create sessionquery session = BaseXClient.bindSession("$name"'localhost', "Number"1984, 'admin', 'admin');
// Call the init method of your query object # perform command and print returned string print querysession.initexecute("xquery 1 to 10");
// Iterate through the query object # close sessionwhile(query.more()) print query session.nextclose();
// Close your query object: # print time neededprint query time = (time.closeclock();- start) * 1000 print time, "ms." except IOError as e: # print exception print e
</pre>
[[Category:Developer]]
[[Category:Server]]
[[Category:Language Bindings]]
bueraucrat, Bureaucrats, editor, reviewer, Administrators
907

edits

Navigation menu