Use JDBC to Access XML Documents in Oracle XML DB

Hi folks,
From the Oracle XML DB Developer's Guide 10g Release 1 (10.1) Chapter 12 Java API for XMLType, it show several examples for how java application use JDBC to access xml in XMLDB:
1. use getOPAQUE() on XMLTYPE table/column and then call XMLTYPE.createXML();
2. use getCLOBVal()/getStringVal()/getBLOBVal() in SQL statement;
3.use getObject on the result and cast directly to XMLType;
Among these 3 options, which is supposed to be the fastest way? Any difference between thin and oci?
I have run some tests about that and the result is the second option (with thin driver) is the fastest. It surprises me because I think oci should be faster than thin. Does the result make sense?
Thanks.

Have you tried to trace your sessions to see how much work is happening? Traces should give you quantifiable information on exact times and access paths to the data.
Below is a link to an O'Reilly book excerpt on Java programming with JDBC. Slightly data, but may be of assistance.
http://www.onjava.com/lpt/a//onjava/excerpt/oraclejdbc_19/index.html

Similar Messages

  • Using Views to access XML Content

    I was wondering if anyone can help me in these questions.
    I created a view to access XML Content in the database for reports. My first question is I have 18 properties in the xml document but when I created the view I only retrieve one property information. What dO I need to change in my XPath query to get all the properties see script below
    CREATE OR REPLACE VIEW AHA_PMCO_BUILDINGS_VIEW
    (BUILDINGID,NUMBEROFFLOORS, CONSTRUCTIONDATE,NAME, BUILDINGTYPE, DEMODISPODATE,MODSTARTDATE,MODENDDATE, ISANNEX) as
    select extractValue(value(p),'/Building/@Id'),
         extractValue(value(p),'/Building/@NumberOfFloors'),
         extractValue(value(p),'/Building/@ConstructionDate'),
         extractValue(value(p),'/Building/@Name'),
         extractValue(value(p),'/Building/@BuildingType'),
         extractValue(value(p),'/Building/@DemolitionDispositionDate'),
         extractValue(value(p),'/Building/@ModernizationStartDate'),
         extractValue(value(p),'/Building/@ModernizationEndDate'),
         extractValue(value(p),'/Building/@IsAnnex')
    from "Pmco438_TAB" X, TABLE(xmlsequence (extract(value(X), '/Pmco/Properties[1]/Property[1]/Buildings/Building')) ) p;
    How do I change my script to retrieve multiple properties instead of just one property
    Thanks
    Dibor

    Hi Paul
    I have access to all the documents (JavaScript via Mozilla, Adobe JavaScript API, XFA API etc etc) but none are specific enough to cater for this issue.  I will work this out before too long but it would be very useful if someone who had done this already could shortcut my journey!
    Thanks
    Roxy

  • Using JDBC to access text file

    I gotta admit I didn't research it much. this is not like 'Help!!! Urgent!!!' question. I'm just curious. how do you work with tab-delimited files using JDBC? what driver do you need? same question goes for .csv files. I'm doing fine by just using file streams (no JDBC), splitting every line (split method of String class) and storing them in array. just curious. there are 10 shmukes for good answer, 5 for tab delimited and 5 for .csv (shmuke is my equivalent of dukes, they are almost as good (both are worthless)). I'll save dukes until I need some real answers.

    Go over to the JDBC forum and do a search...I recently had a discussion of the particulars of this with thomas.kellerer.
    Basically, you can use the Microsoft Text Driver if you're on a Windows platform. The Text driver gives you the option of defining your delimiter and headers for each file in a directory. The directory is considered the catalog (the database), and each file is considered a separate table. Works very well...I'm incorporating it into a project of mine.
    Good luck!

  • -How to use JDBC to connect the SQLServer and Oracle.

    Hi,
    I create a table in the WIP DB, I want to modify this table when use "PRE-START" activity in POD.
    SAPME version: 5.2.3.4     SDK:2.0    DB:SQL2005 and Oracle 10.2g
    SourceCode like below:
    public void execute(StartHookDTO dto) throws Exception {
              initServices();
              try{
                   Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                   Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=SAPMEWIP", "sa" ,"sap12345");
                   conn.close();
              }catch(Exception e){
                   e.printStackTrace();
    Besides, I already setup the JDBC ClassPath in ConfigTool, but it gets somes error when executing.
    the error code like below:
    java.sql.SQLException: No suitable driver
    Please give me some support or a example, thank you so much!
    Br,
    Alex

    You probably want to use the WIP Datasource defined in JNDI.

  • JSP using jdbc to access mdb

    Done ...
    User DSN and System DSN Add. Select Microsoft Access Driver (*.mbd) and data source name is aa
    in JSP ..
    <%@ page import="com.thinweb.sql.*" %>
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection c1 = DriverManager.getConnection("jdbc : odbc : aa","",""); [no spacing]
    Error: 500
    Location: /gone.jsp
    Internal Servlet Error:
    javax.servlet.ServletException: No suitable driver
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
    at _0002fLoginM_0002ejspLoginM_jsp_10._jspService(_0002fLoginM_0002ejspLoginM_jsp_10.java:181)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)
    Root cause:
    com.thinweb.sql.SQLException: No suitable driver
    at com.thinweb.sql.DriverManager.getConnection(Unknown Source)
    at com.thinweb.sql.DriverManager.getConnection(Unknown Source)
    at _0002fLoginM_0002ejspLoginM_jsp_10._jspService(_0002fLoginM_0002ejspLoginM_jsp_10.java:123)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)

    You must have the JdbcOdbcDriver.class in your classpath.

  • How to use JDBC to access "returning " clause

    I think it is important to note here that you DO NOT have to use SQLJ for this. You can achieve the same result in plain JDBC. You must put the PL/SQL block in a CallableStatement object.
    e.g.
    CallableStatement cs = conn.prepareCall("declare myReturnValue table_name.field_name%type; begin insert into table_name (field1, field2, ... fieldn) values (?, ?, ... ?) returning fieldx into ?; end;");
    To get hold of the "returning" parameter, register it as an OUT parameter (method 'registerOutParameter').
    That should do it!! Email me if you need further explanation,
    regards,
    Alex

    I think it is important to note here that you DO NOT have to use SQLJ for this. You can achieve the same result in plain JDBC. You must put the PL/SQL block in a CallableStatement object.
    e.g.
    CallableStatement cs = conn.prepareCall("declare myReturnValue table_name.field_name%type; begin insert into table_name (field1, field2, ... fieldn) values (?, ?, ... ?) returning fieldx into ?; end;");
    To get hold of the "returning" parameter, register it as an OUT parameter (method 'registerOutParameter').
    That should do it!! Email me if you need further explanation,
    regards,
    Alex
    null

  • Oracle to SQL Server using JDBC

    I would like to connect Oracle to SQL Server using JDBC and a java program in oracle using loadjava.
    I cannot seem to get a SQL Server driver to work when loaded into Oracle using loadjava. Outside of oracle, they work just fine. Within oracle, I receive class not found exceptions.
    PLEASE HELP!!!!!!!

    I would like to connect Oracle to SQL Server using JDBC and a java program in oracle using loadjava.
    I cannot seem to get a SQL Server driver to work when loaded into Oracle using loadjava. Outside of oracle, they work just fine. Within oracle, I receive class not found exceptions.
    PLEASE HELP!!!!!!!

  • Any jdbc examples inserting XML doc

    Newbie to xmldb/jdbc/java
    I'm looking for some sample java code that uses jdbc to insert xml docs into the 10g xml db.
    Also looking for sample code that does xquery using JDBC on 10g xmldb.
    (using eclipse on windows)
    any help appreciated

    Does this help, assume that you have an instance of
    public XMLType makeXMLType(OracleConnection conn,Document xmlDocument)
    throws NamingException
    try {
    XMLType xml = null;
    if (xmlDocument != null)
    xml = XMLType.createXML(conn,xmlDocument);
    return xml;
    catch (SQLException sqle)
    NamingException ne = new NamingException(SQLCache.UNEXPECTED_SQL_EXCEPTION);
    ne.setRootCause(sqle);
    throw ne;
    You can then bind the XMLType to an insert statement using setObject.

  • Accessing a document from a different system

    Hi,
    I need to get (display) an attachement stored in EBP from a different R/3 system (in transaction display purchase requisition).
    Could somebody point me to right direction ?
    Thank you for your feedback.
    Marian

    Marian,
    Which version of EBP and R/3 are you using? You can look for an RFC and use it for accessing the document and displaying in R/3
    In my project we had a requirement that the attachments have to be displayed in R/3 purchase orders and we solved it by storing the attachments in document management system in our back end R/3 system and then adding some screen enahncements in PO userexits wherein we accessed the DMS and displayed the attachments.
    But if I remember correctly this required some core modification on the EBP side.
    Regards,
    Vani

  • Trying to store XML documents in Oracle XML repository using Java

    Hi,
    I am trying to store XML documents in Oracle XML Repository using a Java program. i just need a functionality to be able to store XML files and retrieve them.
    Can anybody PLEASE provide me some sample code.
    Thanks in Advance
    Sasha

    Did you ever get any samples on doing this and if so could you pass it on to me.
    Thanks

  • How to select specific element from a XML document using JDBC?

    Hi all,
    I have a problem with selecting specific XML element in Oracle 11g release 1 from my java application. Data are stored in object-relational storage.
    My file looks like:
    <students>
    <student id="1">
    </student>
    <student id="2">
    </student>
    <student id="3">
    </student>
    </students>
    I need to select a specific <student> element. I've already tried few ways to achieve my goal but I failed.
    SELECT extract(OBJECT_VALUE,'/students/student') FROM students - works fine, but this selects all <student> elements
    SELECT extract(OBJECT_VALUE,'/students/student[1]') FROM students - which should select first <student> element works too but it causes exception when using JDBC driver returns:
    java.sql.SQLException: Only LOB or String Storage is supported in Thin XMLType
         at oracle.xdb.XMLType.processThin(XMLType.java:2817)
         at oracle.xdb.XMLType.<init>(XMLType.java:1238)
         at oracle.xdb.XMLType.createXML(XMLType.java:698)
         at oracle.xdb.XMLType.createXML(XMLType.java:676)
         at cz.zcu.hruby.data.Select.getStudent(Select.java:45)
    SELECT to_clob(extract(OBJECT_VALUE,'/students/student[1]')) FROM students - in this case I hoped that DB would convert result to CLOB but the element is quite large (definitely more than 4000 Bytes long which I find out from forum is limit). But this exception occurs:
    java.sql.SQLException: ORA-19011: Character string buffer too small
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:897)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
         at cz.zcu.hruby.data.Select.getStudent(Select.java:40)
    SELECT to_lob(extract(OBJECT_VALUE,'/students/student[1]')) FROM students - I hoped I can convert return value to a LOB value but that doesn't work for me either:
    java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected -, got -
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
         at cz.zcu.hruby.data.Select.getStudent(Select.java:40)
    This behaviour raises two questions:
    1) Why SELECT extract(OBJECT_VALUE,'/students/student') FROM students works but SELECT extract(OBJECT_VALUE,'/students/student[1]') FROM students does't ?
    2) Is there any way how I can select specific element (element XPath /students/student[@id="some value"]) and convert it to String?
    Thanks for your responses I would appreciate any suggestion
    Honza

    To be exact my <student> element is a bit complicated and looks like the one at the end of this post (sorry but it's in czech). And I need to select whole xml fragment (all opening and closing tags included) as it is shown. Maybe I used wrong solution and I should use CLOB storage. I discuss this issue here: Which solution for better perfomance?
    Thanks anyway for your response. I would be very grateful if you have any further idea
    <Student RodneCislo="8051015555">
                   <Jmeno>Petra</Jmeno>
                   <Prijmeni>Nováková</Prijmeni>
                   <RodnePrijmeni>Novotná</RodnePrijmeni>
                   <TitulPred>Bc.</TitulPred>
                   <TitulZa>MBA.</TitulZa>
                   <Adresa>
                        <Okres>3702</Okres>
                        <Obec>582786</Obec>
                        <CastObce>11908</CastObce>
                        <Ulice>Nova</Ulice>
                        <UliceCislo>4</UliceCislo>
                        <PSC>60000</PSC>
                        <Stat>203</Stat>
                   </Adresa>
                   <RodinnyStav>1</RodinnyStav>
                   <StredniSkola>000559024</StredniSkola>
                   <RokMatZkousky>2001</RokMatZkousky>
                   <PPStudent DatumVerifikace="2006-08-04">
                        <SoubeznaStudia>1</SoubeznaStudia>
                        <SoubeznaStudiaMaxDelka>2.0</SoubeznaStudiaMaxDelka>
                        <CelkovaDobaStudia>1817</CelkovaDobaStudia>
                   </PPStudent>
                   <Studia>
                        <Studium VSFakulta="14330" StudijniProgram="B1801" ZapisDoStudia="2001-07-10">
                             <DelkaStudia>5.0</DelkaStudia>
                             <NovePrijaty>N</NovePrijaty>
                             <NavazujiciStudProgram>N</NavazujiciStudProgram>
                   <PredchoziVzdelani>K</PredchoziVzdelani>
                             <PocetRocniku>5</PocetRocniku>
                             <AktualniRocnik>5</AktualniRocnik>
                             <UbytovaniVKoleji>3</UbytovaniVKoleji>
                             <UkonceniStudia Datum="2004-06-28" Zpusob="1" UdelenyTitul="Bc."/>
                             <StudiumEtapy>
                                  <StudiumEtapa PlatnostOd="2001-07-10">
                                       <ObcanstviKvalifikator>1</ObcanstviKvalifikator>
                                       <ObcanstviStat>203</ObcanstviStat>
                                       <PobytVCR>A</PobytVCR>
                                       <JazykVyuky>cze</JazykVyuky>
                                       <StudijniObory>
                                            <Obor>1801R001</Obor>
                                            <Obor>1801R005</Obor>
                                       </StudijniObory>
                                       <AprobaceOboru>
                                            <Aprobace>01</Aprobace>
                                       </AprobaceOboru>
                                       <MistoVyuky>582786</MistoVyuky>
                                       <FormaStudia>P</FormaStudia>
                                       <Financovani>1</Financovani>
                                       <PreruseniStudia>S</PreruseniStudia>
                                       <PlatnostDo>2002-04-24</PlatnostDo>
                                  </StudiumEtapa>
                                  <StudiumEtapa PlatnostOd="2002-04-24">
                                       <ObcanstviKvalifikator>1</ObcanstviKvalifikator>
                                       <ObcanstviStat>203</ObcanstviStat>
                                       <PobytVCR>A</PobytVCR>
                                       <StudijniPobyt Forma="V" Program="51" Stat="056"/>
                                       <JazykVyuky>cze</JazykVyuky>
                                       <StudijniObory>
                                            <Obor>1801R001</Obor>
                                            <Obor>1801R005</Obor>
                                       </StudijniObory>
                                       <AprobaceOboru>
                                            <Aprobace>01</Aprobace>
                                       </AprobaceOboru>
                                       <MistoVyuky>582786</MistoVyuky>
                                       <FormaStudia>P</FormaStudia>
                                       <Financovani>1</Financovani>
                                       <PreruseniStudia>S</PreruseniStudia>
                                       <PlatnostDo>2002-09-01</PlatnostDo>
                                  </StudiumEtapa>
                                  <StudiumEtapa PlatnostOd="2002-09-01">
                                       <ObcanstviKvalifikator>1</ObcanstviKvalifikator>
                                       <ObcanstviStat>203</ObcanstviStat>
                                       <PobytVCR>A</PobytVCR>
                                       <JazykVyuky>cze</JazykVyuky>
                                       <StudijniObory>
                                            <Obor>1801R001</Obor>
                                            <Obor>1801R005</Obor>
                                       </StudijniObory>
                                       <AprobaceOboru>
                                            <Aprobace>01</Aprobace>
                                       </AprobaceOboru>
                                       <MistoVyuky>582786</MistoVyuky>
                                       <FormaStudia>P</FormaStudia>
                                       <Financovani>1</Financovani>
                                       <PreruseniStudia>S</PreruseniStudia>
                                       <PlatnostDo>2004-06-28</PlatnostDo>
                                  </StudiumEtapa>
                             </StudiumEtapy>
                        </Studium>
                        <Studium VSFakulta="14330" StudijniProgram="N1802" ZapisDoStudia="2004-06-29">
                             <DelkaStudia>2.0</DelkaStudia>
                             <NovePrijaty>N</NovePrijaty>
                             <NavazujiciStudProgram>A</NavazujiciStudProgram>
                             <PredchoziVzdelani>R</PredchoziVzdelani>
                             <PocetRocniku>2</PocetRocniku>
                             <AktualniRocnik>1</AktualniRocnik>
                             <UbytovaniVKoleji>3</UbytovaniVKoleji>
                             <SocialniStipendia>
                                  <SocialniStipendium NarokOd="2006-01-01">
    <NarokDo>2006-10-30</NarokDo>
                                  </SocialniStipendium>
                             </SocialniStipendia>
                             <UkonceniStudia Datum="" Zpusob="" UdelenyTitul=""/>
                             <PPStudium DatumVerifikace="2006-07-01">
                                  <NovePrijatyVerif>N</NovePrijatyVerif>
                                  <NovePrijatyKvalif>N</NovePrijatyKvalif>
                                  <NavazujiciStudProgramVerif>A</NavazujiciStudProgramVerif>
                                  <UkonceniStudiaVerif/>
                                  <FinancovanoCR>A</FinancovanoCR>
                                  <SberId>38</SberId>
                                  <DobaStudia>
                                       <Cista>733</Cista>
                                       <VcetneNeuspechuDanehoTypu>733</VcetneNeuspechuDanehoTypu>
                                       <VcetneVsechNeuspechu>733</VcetneVsechNeuspechu>
                                  </DobaStudia>
                                  <PrestoupenoKamPosledni VSFakulta="14330" StudijniProgram="N1802" ZapisDoStudia="2004-06-29"/>
                                  <UbytovaciStipendiumKod/>
                             </PPStudium>
                             <StudiumEtapy>
                                  <StudiumEtapa PlatnostOd="2004-06-29">
                                       <ObcanstviKvalifikator>1</ObcanstviKvalifikator>
                                       <ObcanstviStat>203</ObcanstviStat>
                                       <PobytVCR>A</PobytVCR>
                                       <JazykVyuky>eng</JazykVyuky>
                                       <StudijniObory>
                                            <Obor>1801T001</Obor>
                                            <Obor>1801T025</Obor>
                                       </StudijniObory>
                                       <AprobaceOboru>
                                            <Aprobace>01</Aprobace>
                                       </AprobaceOboru>
                                       <MistoVyuky>582786</MistoVyuky>
                                       <FormaStudia>P</FormaStudia>
                                       <Financovani>1</Financovani>
                                       <PreruseniStudia>S</PreruseniStudia>
                                       <PlatnostDo/>
                                       <PPStudiumEtapa DatumVerifikace="2006-07-01">
                                            <FinancovaniVerif>1</FinancovaniVerif>
                                            <StudentRozpoctovy>O</StudentRozpoctovy>
                                            <SberId>38</SberId>
                                       </PPStudiumEtapa>
                                  </StudiumEtapa>
                             </StudiumEtapy>
                        </Studium>
                   </Studia>
              </Student>

  • Loading big XML files using JDBC gives errors

    Hi,
    I've created a XMLType table using binary storage, with the restriction that any document stored has a (any) schema:
    CREATE TABLE XMLBIN OF XMLTYPE
    XMLTYPE STORE AS BINARY XML
    ALLOW ANYSCHEMA;Then I use JDBC to store a relatively large document using the following code:
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    String connectionString = "jdbc:oracle:thin:@host:1521:sid";
    File f = new File("c:\\temp\\big.xml");
    Connection conn = DriverManager.getConnection(connectionString, "username", "password");
    XMLType xml = XMLType.createXML(conn,new FileInputStream(f));
    String statementText = "INSERT INTO xmlbin VALUES (?)";
    OracleResultSet resultSet = null;
    OracleCallableStatement statement = (OracleCallableStatement)conn.prepareCall(statementText);
    statement.setObject(1,xml);
    statement.execute();
    statement.close();
    conn.commit();
    conn.close();Loading a file of 61Mb (real Mb, in non-IT Mb (where 1Mb seems to be 10^6) it is 63.9Mb) or less doesn't give any errors, loading a file bigger then that gives the following error:
    java.sql.SQLRecoverableException: Io exception: Software caused connection abort: socket write error
            at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
            at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:458)
            at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:960)
            at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
            at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
            at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3482)
            at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3856)
            at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1373)
            at jdbctest.Tester.main(Tester.java:60)A succesful insert of a 63Mb file takes about 23 seconds to execute. The 70Mb file fails already after a few seconds, so I'm ruling out any time outs.
    I'm guessing there are some buffers that need to be enlarged, but don't have a clue which ones.
    Anyone any idea what might cause the problem and how to resolve?
    My server runs Oracle 11g Win32. The client is Windows running Sun Java 1.6, using ojdbc6.jar and Oracle 11g Client installed.
    Cheers,
    Harald

    Hi Mark,
    The trace log in the OEM shows me:
    Errors in file d:\oracle11g\app\helium\diag\rdbms\helium\helium\trace\helium_ora_6948.trc  (incident=7510): ORA-07445: exception encountered: core dump [__intel_new_memcpy()+613] [ACCESS_VIOLATION] [ADDR:0x0] [PC:0x6104B045] [UNABLE_TO_WRITE] []  If needed I can post the full contents (if I find out how, am still a novice :-))
    Cheers,
    Harald

  • Use JDBC connection XML DB

    Hello everyone:
    I use JDBC OCI Driver to connection XML DB , but I got some error message and I don't know what's wrong .Following is my error message and Code.
    thanks
    java.sql.SQLException: ORA-00904: "R"."RESOLVE_PATH": ID 無效
    my code
    Class.forName("oracle.jdbc.OracleDriver");
    Connection conn=DriverManager.getConnection("jdbc:oracle:oci8:@XBRL","gomin","gomin");
    OraclePreparedStatement stmt = (OraclePreparedStatement)
    conn.prepareStatement("SELECT r.RESOLVE_PATH('/Company/NSFT') FROM XDB$RESOURCE r");
    ResultSet rset = stmt.executeQuery();
    OracleResultSet orset = (OracleResultSet)rset;
    while(orset.next())
    // get the XMLType
    XMLType poxml = XMLType.createXML(orset.getOPAQUE(1));
    // get the XMLDocument as a string...
    Document podoc = (Document)poxml.getDOM();
    System.out.println(podoc.getNamespaceURI());
    }

    Genrally the SQL Exception ORA-00904 is thrown when
    "The column name entered is either missing or invalid"
    Check out the following :
    => Enter a valid column name. A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #. If it contains other characters, then it must be enclosed in double quotation marks.
    =>It may not be a reserved word.
    Hope it helps
    Shefali

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • Error while loading xml files using JDBC

    Hi,
    I am trying to load xml files into an xmltype table using JDBC calls and am getting this error for some files
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    The xml files and our database are both UTF-8 encoded. The version of oracle that we have here is 9.2.0.6
    Any suggestions in this matter will be greatly appreciated.
    Thanks,
    Uma

    I also experienced this problem and unfortunately this solution didn't work for me given that the tag you suggested was already on the XML file.

Maybe you are looking for

  • Issue in using custom event from outreach

    Hi I have created a custom event and executed a scenario successfully for this custom event from ACC. But when I try to configure the same event from Outreach(BCC), I am able to see this custom event in the list of available events, but after selecti

  • What's the best approach to automatically upload file to Sharepoint?

    Hi xMII experts, Does anyone  have experience on  how to automatically upload the file Sharepoint(Windows Sharepoint Services) ?  I tried to google but only find the below solutions: --Create a .Net  application.Write the Webservice reference in the

  • Replication between Oracle and SQL Server

    Does anyone have any experience with replicating data between SQL Server and Oracle database system? If so, I am experiencing time out errors when replicating data. I replicating from SQL Server 2k to Oracle and it time out on the Oracle side.

  • Developing, Deploying, Managing Web Services with Oracle9i

    HOWTO: The "Hello, World!" Sample Project Follow these steps to create, compile, and run a simple Java program in JDeveloper: 1.Create a project. Choose File | New Empty Project. A new project node, with a name resembling MyProject1.jpr will appear i

  • Any Web Apps for Contact List (by company)

    *Does anyone know of any Web Apps that let you access contacts by company name?* Hopefully, they will sync with either Outlook or the iPhone database, at least initially. I have been looking for Web Apps that backup and display contacts on teh web th