Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP: XML-0108: (Fatal Error) Start of root element expected
Hi,
See the following program which is running fine, if you cut paste that file into a String and pass it to the save function.
import java.sql.*;
import oracle.xml.sql.query.OracleXMLQuery;
import oracle.xml.sql.dml.OracleXMLSave;
import java.io.*;
public class testInsert
{
public static void main(String argv[]) throws SQLException
{
Connection conn = getConnection("law1","law1");
OracleXMLQuery qry = new OracleXMLQuery(conn,"SELECT name as T,
Reptype as C FROM Key_reptype");
String str = qry.getXMLString();
try{ OracleXMLSave sav = new OracleXMLSave(conn, "law1.titles"); sav.insertXML(str); sav.close(); }catch(Exception ex){System.out.println(ex.toString());}}
throws SQLException
{
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@portal:1521:star",
username,password);
return conn;
}
}
thanks
Sunil Dua
nirmalyamishra <member_at_dbforums.com> wrote in message news:<3c972ecc$1_1_at_spamkiller.newsgroups.com>...
> Hi All,
>
> I am facing the same problem as below
>
> I was trying to insert data from a XML file into oracle table using
> XSU(XML-SQL Utilities). The program was compiled but I am getting the
> following error when I tried to run the program in JVM.
>
>
> <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element
> expected. Error in insert: oracle.xml.sql.OracleXMLSQLException: Start
> of root element e xpected.
>
> Can any one give any tips or pointers for this.
>
> Please mail at mailto:nirmalya_mishra_at_infy.com
>
> Cheers
>
> Nirmalya Mishra
Received on Fri Apr 05 2002 - 00:59:13 CST
![]() |
![]() |