Article View: fr.comp.text.xml
Article #9662Re: Probleme insertion Oracle XSU
From: Doeni
Date: Wed, 21 Feb 2001 19:45
Date: Wed, 21 Feb 2001 19:45
72 lines
3007 bytes
3007 bytes
sgahagno@ifremer.fr (Stephane GAHAGNON) writes:
> Bonjour,
> Je n'arrive pas a inserer certains tags (ID et NO) dans une base Oracle en
> utilisant la procedure XSU JAVA API (disponible avec Oracle XSU 111)
> Pour compiler j'utilise : javac put.java
> Pour executer : java put "put.xml"
>
> Merci d'avance.
>
> Voici mon XML:
>
> <?xml version="1.0"?>
> <DATABASE>
> <PERSONNE>
> <NO>1</NO>
> <NOM>toto</NOM>
> <PRENOM>titi</PRENOM>
> </PERSONNE>
> <PERSONNE>
> <NO>2</NO>
> <NOM>tutu</NOM>
> <PRENOM>tata</PRENOM>
> </PERSONNE>
> </DATABASE>
>
> Mon fichier put.java :
>
> import java.sql.*;
> import oracle.xml.sql.dml.OracleXMLSave;
> public class put
> {
> public static void main(String argv[])
> throws SQLException
> {
> Connection conn = getConnection("admin","admin");
> OracleXMLSave sav = new OracleXMLSave(conn, "test");
> String [] colNames = new String[40];
> colNames[0] = "NO";
> colNames[1] = "NOM";
> sav.setUpdateColumnList(colNames); // set the columns to update..!
> // Assume that the user passes in this document as the first
> argument!
> sav.insertXML(argv[2]);
> sav.close();
> }
> // Get the connection given the user name and password..!
> private static Connection getConnection(String user, String passwd)
> throws SQLException
> {
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> Connection conn =
>
> DriverManager.getConnection("jdbc:oracle:oci8:@test","admin","a
> dmin");
> return conn;
> }
> }
>
>
>
Il y a une classe quasiment toute faite pour charger un fichier
fichier : tape 'java OracleXML' pour avoir la syntaxe.
Arrives-tu � charger tes donn�es de cette fa�on ?
Sinon tu as quelle erreur ?
--
Rien n'est jamais perdu tant qu'il reste quelque chose � trouver.
-Pierre Dac
Technical Details
Message-ID:
<87ae7fizux.fsf@dinosaur.evhr.net>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!isdnet!inetway!inetway.net!not-for-mailReferences:
<01C09B2B.4292F480.sgahagno@ifremer.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,d42fb50d713cd239 X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-02-21 11:46:21 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!isdnet!inetway!inetway.net!not-for-mail From: Doeni <doeni@evhr.net> Newsgroups: fr.comp.text.xml Subject: Re: Probleme insertion Oracle XSU Date: 21 Feb 2001 20:45:58 +0100 Organization: Ni dieu ni b�te Lines: 72 Message-ID: <87ae7fizux.fsf@dinosaur.evhr.net> References: <01C09B2B.4292F480.sgahagno@ifremer.fr> NNTP-Posting-Host: cm60-10.evhr.net Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: reader1.fr.uu.net 982785944 8333 212.94.210.60 (21 Feb 2001 20:05:44 GMT) X-Complaints-To: abuse@fr.uu.net NNTP-Posting-Date: 21 Feb 2001 20:05:44 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley)