Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    29

    Question Unanswered: ORA-01729: for XMLType

    Hi all,
    i want to insert the xml data in my table with xmltype. At first i store these xml daten in another table as clob. But i get always the error message
    ORA-01729: database link name expected
    during the insert the xml data in xmltype column.

    For the clobtable:
    PreparedStatement pstmt_clob = con.prepareStatement("INSERT INTO clobtable VALUES(?, ?)");
    ...
    pstmt_clob.setInt(1, f+1);
    pstmt_clob.setCharacterStream(2, new java.io.FileReader(f_ordner[f+1]), (int)f_ordner[+1].length());
    pstmt_clob.execute();

    For the xmltable:
    Connection conn = connect();
    stmt.executeUpdate("UPDATE xmltable SET xml_dok = XMLTYPE.createXML(" + conn + "," + rs.getClob(2) + ")WHERE id =" + nr);

    Code for connection:
    public Connection connect() throws Exception {
    Class.forName("oracle.jdbc.OracleDriver");
    Connection conn = DriverManager.getConnection(
    "jdbcracleci:@zeus", "zhou", "diplom");
    return conn;
    }

    I don't know, what's wrong with my programm. Can you help me?


    thank you very much and greeting from germany


    rabbit

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    I suggest you use SQL*Plus to first get the desired SQL work,
    and worry about getting it to work from Java. If you can't get
    the desired results from SQL*Plus, you do not stand a chance
    to get it working from Java.

  3. #3
    Join Date
    Nov 2003
    Location
    Bangalore, INDIA
    Posts
    333

    Thumbs up

    Hi,

    A database link name does not follow @ in a reference to a table in a remote database. Follow this format,

    username.table_name@ database_name
    SATHISH .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •