The example of this article tells the method of Java connection and operating the SEDNA XML database. Share it for everyone for your reference. The specific analysis is as follows:
SEDNA is a native XML database that provides full -functional core database services, including persistence storage, Acid affairs, indexing, security, heat preparation, UTF8, etc. Implement the W3C XQuery specification, support full -text search and node level update operations.
Import Ru.ispras.setna.driver.*; Public Class Sednaclient {Public Static void Main (String ARGS []) {SEDNACONNECTION CON = NULL; Try { /* get a conne Next */ con = databaseManager.getConnection ("LocalHost", "TESTDB", "System", "Manager"); /* Begin a New Transaction* /Con.begin (); /* Create Statement* /Sednastatement St = Con.createsStatement (); /* Load Xml into The database * / System.out.println ("loading data ..."); Boolean res; res.execute ("load 'c: /region.xml' ''"); Region.xml '"+" has ben loaded successFully "); )/*/*" ); / * Print Query Results * / PrintQueryResults (ST); / * Remove Document * / System.Println ("Removing Document ..."); Res.execute ("Drop DOC Ument 'region' "); System.out.println ("Document 'Region'" + "Has Been Dropped SuccessFully"); on E) {e.printstacktrace ();} Finally { /* Properly Close Connection* /Try {if (con! = Null) con.close ();} Catch (DriveRexception E) {e.printstacktrace (); Y Results */ Private Static Void PrintQueryResults (SEDNASTATEMENT) Throws DriveRexception {int Count = 1; String item; SednserializeDresult PR = St.GetserializedResult (); whi. le ((item = pr.Next ())! = Null) {system.out.println (count + " item: "+item); count ++;}}}It is hoped that this article is helpful to everyone's Java program design.