Article View: fr.comp.text.xml
Article #9669Re: re: probleme insertion oracle xsu
From: yc
Date: Thu, 22 Feb 2001 14:28
Date: Thu, 22 Feb 2001 14:28
71 lines
3467 bytes
3467 bytes
>heu c'est normal ca ???? :
<PAYS>france</FRANCE>
J'y connais rien en oracle, mais en xml c'est pas correct.... il faut /PAYS
a la place de /FRANCE ;-)
yann
"Stephane GAHAGNON" <sgahagno@ifremer.fr> wrote in message
news:01C09CD7.325E0CA0.sgahagno@ifremer.fr...
> En fait j'ai presque resolu mon probleme avec ce code. Les champs ID et
NOM
> font partie d'une table et les PAYS et VILLE d'une autre.
> Je ne sais pas comment faire pour inserer uniquement les champs ID et NOM
> dans la table concernee.
>
> Voila l'erreur :
> oracle.xml.sql.OracleXMLSQLException: Exception ' The XML element tag
> 'PAYS' does not match the name of any of the columns/attributes of the
> target database object.' encoutered during processing ROW element 0All
> prior XML row changes were rolled back. in the XML document
> at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:1962)
> at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:1880)
> at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1013)
>
> Code java :
>
> import oracle.xml.sql.*;
> import java.sql.*;
> import oracle.jdbc.driver.*;
> import oracle.jdbc.*;
> import java.net.*;
> public class put
> {
> public static void main(String argv[])
> throws SQLException
> {
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> Connection conn =
> DriverManager.getConnection("jdbc:oracle:oci8:admin/admin@test");
> String tabName = "TEST"; // table into which to insert
> String fileName = "put.xml"; // the file containing the XML doc
> OracleXMLSave sav = new OracleXMLSave(conn,tabName);
> String [] colNames = new String[2];
> colNames[0] = "ID";
> colNames[1] = "NOM";
> sav.setUpdateColumnList(colNames); // set the columns to update..!
> sav.setIgnoreCase(true);
> URL url = sav.createURL(fileName);
> int rowCount = sav.insertXML(url);
> System.out.println(" successfully inserted "+rowCount+" rows into
> "+tabName);
> conn.close();
> }
> }
>
> Fichier put.xml :
> <?xml version = '1.0'?>
> <ROWSET>
> <ROW>
> <ID>1</ID>
> <NOM>toto</NOM>
> <PAYS>france</FRANCE>
> <VILLE>Paris</VILLE>
> </ROW>
> </ROWSET>
>
> Merci d'avance pour vos reponses.
>
> --
> Posted from brest.ifremer.fr [134.246.155.1]
> via Mailgate.ORG Server - http://www.Mailgate.ORG
Technical Details
Message-ID:
<nobl6.1$M8.1175@tengri.easynet.fr>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!fr.clara.net!heighliner.fr.clara.net!news.tele.dk!194.42.224.136!diablo.netcom.net.uk!netcom.net.uk!easynet-monga!easynet.net!feed1.news.be.easynet.net!tengri.easynet.fr!not-for-mailReferences:
<01C09CD7.325E0CA0.sgahagno@ifremer.fr>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114f60,c0095c379eae8812 X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-02-22 08:58:02 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!fr.clara.net!heighliner.fr.clara.net!news.tele.dk!194.42.224.136!diablo.netcom.net.uk!netcom.net.uk!easynet-monga!easynet.net!feed1.news.be.easynet.net!tengri.easynet.fr!not-for-mail From: "yc" <ychambionnat@wis.fr> Newsgroups: fr.comp.text.xml References: <01C09CD7.325E0CA0.sgahagno@ifremer.fr> Subject: Re: re: probleme insertion oracle xsu Lines: 73 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <nobl6.1$M8.1175@tengri.easynet.fr> Date: Thu, 22 Feb 2001 15:28:56 +0100 NNTP-Posting-Host: 212.11.22.2 X-Complaints-To: abuse@easynet.fr X-Trace: tengri.easynet.fr 982860435 212.11.22.2 (Thu, 22 Feb 2001 17:47:15 MET) NNTP-Posting-Date: Thu, 22 Feb 2001 17:47:15 MET Organization: [Posted via] Easynet France