|Computer|Blogging|Programming|Informatics|Network|Technology|
Seperti perintah pada basis data RDBMS (Relational Database Management System), maka modifikasi dokumen pada database XML Xindice juga terdiri dari INSERT, UPDATE dan DELETE. Untuk setiap tahap perintah akan dipergunakan perintah konsolnya. Adapun karena perintah XUpdate ini bisa sangat panjang dan memerlukan modifikasi yang sering, maka pada utilitas konsol, perintah tersebut disimpan di dalam file teks tersendiri, untuk kemudian disertakan nama filenya pada setiap perintah modifikasi dokumen. Sedangkan untuk versi Java, baik perintah INSERT, UPDATE atau DELETE tidak mempunyai perbedaan kode, melainkan tentu saja sintaksis dari perintah XUpdate yang diinginkan. Berikut adalah kode progam Java yang diperlukan untuk menjalankan perintah XUpdate tersebut:
package test.xindiced;
import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;
public class XUpdate {
public static void main(String[] args) throws Exception {
Collection col = null;
try {
String driver = “org.apache.xindice.client.xmldb.DatabaseImpl”;
Class c = Class.forName(driver);
Database database = (Database) c.newInstance();
DatabaseManager.registerDatabase(database);
col = DatabaseManager.getCollection(“xmldb:xindice:///db/edyâ€);
String xpath = “//pasien[nomorinduk=1518989]/nama”;
String data = “Edy Winarno”;
String xupdate=”" +
“” + data + “” +
“”;
XUpdateQueryService service =
(XUpdateQueryService) col.getService(“XUpdateQueryService”, “1.0″);
service.update(xupdate);
} catch (XMLDBException e) {
System.err.println(“XML:DB Exception occured ” + e.errorCode + ” ” +
e.getMessage());
} finally {
if (col != null) {
col.close();
}
}
}
}
Perbedaan program ini dengan program Java yang menggunakan query dengan XPath, adalah service yang di-instansiasi. Jika yang menggunakan XPath service adalah bertipe XPathQueryService, maka disini service bertipe XUpdateQueryService, seperti ditunjukkan pada potongan program ini:
…
XUpdateQueryService service =
(XUpdateQueryService)
col.getService(“XUpdateQueryService”, “1.0″);
service.update(xupdate);
…
Adapun nilai dari variabel xupdate yang akan menentukan efek dari eksekusi servis tersebut, yang bisa bertipe INSERT, UPDATE ataupun DELETE.
1. Perintah INSERT.
Untuk menambah data pada dokumen XML, akan diperlihatkan data sebelum perintah INSERT ditambahkan, sebagaimana berikut ini:
D:\Program\xml-xindice-1.1\bin>xindice xpath -c /db/edy -q “//pasien”
trying to register database
<pasien src:col=”/db/edy” src:key=”pasien” xmlns:src=”http://xml.apache.org/xindice/Query”><nomorinduk>1518989</nomorinduk><nama>Edy Winarno</nama><nomoridentitas>KTP-229988221</nomoridentitas> <tempatlahir>Semarang</tempatlahir><jeniskelamin>Pria</jeniskelamin>Â <golongandarah>A</golongandarah><tinggi>165</tinggi><berat>67</berat><telepon>024-588-xxx</telepon>Â Â Â <pekerjaan>Dosen</pekerjaan><alergiobat>Amoxycillin</alergiobat><alamat>Semarang</alamat><riwayatpemeriksaan /></pasien>
Untuk menambahkan data baru, yaitu pasien dengan nomorinduk 1518989, maka dipergunakan perintah modifikasi XUpdate yang disimpan ke dalam file insert2.xml berikut ini:
<xupdate:modifications version=”1.0″ xmlns:xupdate=”http://www.xmldb.org/xupdate”>
<xupdate:append select=”/daftar_pasien”>
<xupdate:element name=”pasien”>
<nomorinduk>1518990</nomorinduk>
<nama>Yuni Astuti</nama>
<nomoridentitas>KTP-1109099922</nomoridentitas>
<tempatlahir>Semarang</tempatlahir>
<jeniskelamin>Wanita</jeniskelamin>
<golongandarah>O</golongandarah>
<tinggi>160</tinggi>
<berat>45</berat>
<telepon>024-566-xxx</telepon>
<pekerjaan>Swasta</pekerjaan>
<alergiobat>Amphicillyn</alergiobat>
<alamat>Semarang</alamat>
<riwayatpemeriksaan/>
</xupdate:element>
</xupdate:append>
</xupdate:modifications>
(Perintah modifikasi XUpdate untuk INSERT)
Untuk mengeksekusi perintah dalam file insert.xml tersebut, dilakukan perintah konsol berikut ini:

Gambar 1. Eksekusi Perintah dalam file insert.xml
Hasil dari proses tersebut adalah penambahan data pasien baru dengan nomorinduk 1518990 berikut ini :
Gambar 2. Â Hasil Eksekusi Perintah XUpdate INSERT
Pada tampilan tersebut di atas, tampak bahwa data sudah bertambah dengan data baru yaitu pasien dengan nomor 1518990
(Bersambung…)
(winarnoedy@gmail.com)
Well I truly liked studying it. This article offered by you is very helpful for correct planning.
Actually one of the many challenges which individuals beginning a new on-line firm face are obtaining website visitors to their net site.
Many thanks for this interesting post. I will probably be likely to tell others in regards to this site
Excellent post. Cant wait to view the next text.
Hi! Your house is valueble for me. Thanks!
The acceptance of video submission sites akin to YouTube is rising at a steady pace. Films are considered to be efficient ways to place forth a concept, expertise entertainment, convey information, and even advertise and market products. Undeniably, you possibly can achieve video success with all the right information and quality work. An individual can boost YouTube views as part of your films and help your net presence regardless if up against rough competition.
Daniel, yea I noticed what we probably did there. I seriously favored that part, however hehe I am not that harsh like my dad with one of these things. He continuously informs me loopy stories again inside day and calls me a loser. I assume it’s the time I move out of my father and mother basement LOL. Aaanyways, have you considered you? simply what does your dad think xD Anyway, at my language, there will stop lots good supply similar to this.
I do believe this is certainly one of the most vital information in my opinion. And i’m glad reading your article. But should remark on few general things, The site style is ideal, the articles is absolutely excellent : D. Good job, cheers
huge written piece. I just discovered internet site and desired to inform you that I have certainly enjoyed browsing your blogs. Just the same I will be after the feed and i also hope you’re posting again soon.
The contextual educating style featured inside the Jamorama will not make you training yourself in your room for too long periods at a time longing for a small improvement. The best way to gain knowledge music should be to have fun with other, better, musicians. Jamorama gives you which has a solution to study on among the better qualified person guitarists, including jam monitor recordings than enable you to play together with the pros. This extensive multimedia bundle carries a guitar-playing tuition book, ear schooling game, music browsing game, tuning software, a metronome, and video lessons.
Excellent post. I’d been checking constantly this site and Im impressed! Very useful info specifically the very last part
I care for such information much. I became looking for this specific information for the quite a while. Appreciate it and all the best ..
I loved as much as you’ll receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get bought an shakiness over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly very often inside case you shield this increase.
I simply want to mention I am beginner to blogging and actually liked this web page. More than likely I’m going to bookmark your blog post . You actually come with tremendous stories. Thank you for revealing your web site.
I do think this is certainly just about the most vital information personally. And i’m glad reading your article. But should remark on few general things, The internet site style is perfect, the articles is basically excellent : D. Good job, cheers
Just right points?I’d note that as any person who in reality doesn’t write on blogs so much (in truth, this can be my first submit), I don’t think the time period ‘lurker’ may be very becoming to a non-posting reader. It’s not your fault in the slightest degree , but most likely the blogosphere may come up with a greater, non-creepy name for the ninety% people that experience studying the content material .
here is the guy who the giants need to hire as the next gm
some genuinely prize blogs during this web site , saved to bookmarks .
“The greatest happiness of life is the conviction that we are loved; loved for ourselves, or rather, loved in spite of ourselves.” ~ Victor Hugo
Give your website a boost on this free web directory
who can resist a bent halloween with gus van sant??
My brother suggested I might like this website. He was entirely right. This post actually made my day. You cann’t imagine just how much time I had spent for this info! Thanks!
So when you cross a street you dont look both ways because the cars will usually stop for you?Our higher intellect gives us the ability to think ahead and anticipate danger. Is there a problem with being prepared?
Read it, liked it, thanks for it
An fascinating communicating is couturier scuttlebutt. I cogitate that you should indite author on this subject, it mightiness not be a bias issue but generally grouping are not sufficiency to communicate on such topics. To the succeeding. Cheers like your Modifikasi Dokumen XML dengan XUpdate pada Xindice | EdyWinarno.Com.
person finding identical rss challenge? Anybody who knows kindly respond. Thnkx
At this point, I dont care where Obama was born. We just need to make sure hes a one term president. We need to vote out all those who have voted for Obamas programs. Check each of your congresspeoples voting records. There are some good guys up there and we need to keep them. They, at least, have their heads on straight.
Aye, youd need to be about 110, Icedog. Nee Sky HD in those days, either.
Your internet site is very slow because of open
Heya, I needed to ask you some thing. Is this site a wordpress blog site? I will be wondering about shifting my blog site from Blogger to wordpress, do you think this can be probable? In addition did you create the following theme by yourself some how? Many thanks for the assistance!
Full of propaganda and revisionist history. Niall F. must be on the Rothschild payroll.
Whats with the Bush/Greenspan bashing regarding money. Was everyone asleep when the Democrats were in control the last two years of Bushs administration. Its Barney Frank and his crowd whos to blame! This show is just another left-wing fraud.
its not about liberals and conservatives.thats ridiculous. Its about just seeing beyond the divisive lies of right/left paradigms and getting the courage to stand up for the obvious truth that out shines the good guy/bad guy game. So grow up people and stop playing their trifling game!
AT&T calls for speed. Erratic pitching, erratic hitting, you have to expect some of that with any team. Speed does not slump.
Thank you for making the sincere strive to provide an explanation for this. I think very sturdy approximately it and wish to be told more. If it’s OK, as you reach extra extensive wisdom, might you thoughts adding extra posts similar to this one with additional information? It could be extremely helpful and useful for me and my colleagues.
I picture this could be numerous upon the written content? then again I nonetheless consider that it may be suitable for nearly any type of subject material, as a result of it would often be pleasant to resolve a warm and delightful face or perhaps pay attention a voice when initial landing.
WONDERFUL Post.thanks for share..more wait .. …
I couldn’t get some of one’s links to work. Like your rss link just sent me back to your main page.
It is a remarkably amazing powerful resource that you’re offering and you simply provide it away cost-free!! I comparable to discovering websites of which understand the particular importance of supplying you with beautiful learning resource for zero cost. We truly dearly loved examining this web site. Have fun here!
An fascinating treatment is worth interpret. I conceive that you should correspond many on this issue, it might not be a inhibition message but generally group are not enough to speak on much topics. To the next. Cheers like your Modifikasi Dokumen XML dengan XUpdate pada Xindice | EdyWinarno.Com.
I expressly believe that a large group of Men (men and women) will save the Constitution of the United States when it hangs by a thread. They will take the Constitution into the Tops of the Mountains and hold it up as an Ensign to ALL NATIONS.
The Nazis at Auschwitz-Birkenau, CheÅ‚mno, Bełżec, Majdanek, Sobibór, and Treblinka were all just following orders.