Loading ...
Sorry, an error occurred while loading the content.
 

newbie question

Expand Messages
  • germanpulido
    Hello, Im trying to use XML-DBMS towards a PosgreSQL database, im using the PostgreSQL JDBC Driver and I get this error: java.sql.SQLException: Maximum number
    Message 1 of 3 , Mar 1, 2002
      Hello,

      Im trying to use XML-DBMS towards a PosgreSQL database, im using the
      PostgreSQL JDBC Driver and I get this error:

      java.sql.SQLException: Maximum number of active statements exceeded

      When running "Transfer -toxml sales.map sales_in.xml".
      I have read here that this error is a problem with the JDBC
      postgresql driver which returns always 1 to meta.getMaxStatements()
      and can be solved by setting maxActiveStmts = Integer.MAX_VALUE in
      getDatabaseMetadata(). Am I right?

      I have made the change, but now i run into problems trying to compile
      the whole thing. Im a java newbie and have only used already made ant
      commands when I needed to compile any source.
      Can someone please give me some advice on how should I set the
      classpath and the source files and the easyest way to compile and
      make the jar file?. I think some of this should be in the XML-DBMS
      documentation.

      Thanks a lot,

      Antonio Pulido.
    • Ronald Bourret
      ... You can try this, but I don t know if it will work. Supposedly, PostgreSQL doesn t have a limitation on the number of active statements, but I don t know
      Message 2 of 3 , Mar 6, 2002
        germanpulido wrote:
        >
        > Im trying to use XML-DBMS towards a PosgreSQL database, im using the
        > PostgreSQL JDBC Driver and I get this error:
        >
        > java.sql.SQLException: Maximum number of active statements exceeded
        >
        > When running "Transfer -toxml sales.map sales_in.xml".
        > I have read here that this error is a problem with the JDBC
        > postgresql driver which returns always 1 to meta.getMaxStatements()
        > and can be solved by setting maxActiveStmts = Integer.MAX_VALUE in
        > getDatabaseMetadata(). Am I right?

        You can try this, but I don't know if it will work. Supposedly,
        PostgreSQL doesn't have a limitation on the number of active statements,
        but I don't know if that's actually true. If this doesn't work, you can
        try the JDBC driver mentioned in the following message instead:

        http://groups.yahoo.com/group/xml-dbms/message/1670

        > I have made the change, but now i run into problems trying to compile
        > the whole thing. Im a java newbie and have only used already made ant
        > commands when I needed to compile any source.
        > Can someone please give me some advice on how should I set the
        > classpath and the source files and the easyest way to compile and
        > make the jar file?.

        I'll answer this in a separate email.

        > I think some of this should be in the XML-DBMS
        > documentation.

        I've added it as a doc bug.

        -- Ron
      • germanpulido
        I got it working! To sum up and to the newbie like me out there that is having problems using XML-DMBS 1.01 with PostgreSQL A) Using the JDBC
        Message 3 of 3 , Mar 6, 2002
          I got it working!

          To sum up and to the newbie like me out there that is having problems
          using XML-DMBS 1.01 with PostgreSQL

          A) Using the JDBC org.postgresql.Driver
          =====================================

          1- Transfer from XML to DBMS works fine.

          2- Transfer from DBMS to XML gives the following error:
          java.sql.SQLException: Maximum number of active statements
          exceeded.

          3- To get it to work, simply edit Map.java and look for the method
          getDatabaseMetadata(). Set maxActiveStmts to always be
          Integer.MAX_VALUE like:

          maxActiveStmts = meta.getMaxStatements();
          //if (maxActiveStmts == 0)
          // {
          maxActiveStmts = Integer.MAX_VALUE;
          // }
          preparedSurviveCommit = meta.supportsOpenStatementsAcrossCommit();

          4- Compile using ant with Ben Hall´s build.xml from
          http://groups.yahoo.com/group/xml-dbms/message/2043
          (Great job Ben, I only had to take out "Oracle_2" in "depends"
          from "compile_all")

          5- It works!

          B) Using Sun´s JdbcOdbcDriver towards PostgreSQL ODBC
          =====================================================

          1- Transfer from XML to DBMS works fine.

          2- Transfer from DBMS to XML gives the following error:
          java.sql.SQLException: ResultSet is closed

          3- To get it to work, simply edit DBMStoDOM.java look for the method
          processRelatedTables and comment out rs.close() like:

          // rs.close();
          map.checkInSelectStmt(select, rsMap.table.number, i);

          4- Compile like in A-4

          5- It works!


          You can also try out jxdbcon driver (another JDBC for postgreSQL) I
          never got it working, I think is because I didnt set it up correctly.

          > try the JDBC driver mentioned in the following message instead:
          >
          > http://groups.yahoo.com/group/xml-dbms/message/1670
          >


          The solutions came from all the postings here. Thanks to everyone.

          One question for the people that really understands what is going on
          here:
          Which solution it the best for a production environment A or B?

          Thanks again.

          german antonio pulido





          --- In xml-dbms@y..., Ronald Bourret <rpbourret@r...> wrote:
          > germanpulido wrote:
          > >
          > > Im trying to use XML-DBMS towards a PosgreSQL database, im using
          the
          > > PostgreSQL JDBC Driver and I get this error:
          > >
          > > java.sql.SQLException: Maximum number of active statements
          exceeded
          > >
          > > When running "Transfer -toxml sales.map sales_in.xml".
          > > I have read here that this error is a problem with the JDBC
          > > postgresql driver which returns always 1 to meta.getMaxStatements
          ()
          > > and can be solved by setting maxActiveStmts = Integer.MAX_VALUE in
          > > getDatabaseMetadata(). Am I right?
          >
          > You can try this, but I don't know if it will work. Supposedly,
          > PostgreSQL doesn't have a limitation on the number of active
          statements,
          > but I don't know if that's actually true. If this doesn't work, you
          can
          > try the JDBC driver mentioned in the following message instead:
          >
          > http://groups.yahoo.com/group/xml-dbms/message/1670
          >
          > > I have made the change, but now i run into problems trying to
          compile
          > > the whole thing. Im a java newbie and have only used already made
          ant
          > > commands when I needed to compile any source.
          > > Can someone please give me some advice on how should I set the
          > > classpath and the source files and the easyest way to compile and
          > > make the jar file?.
          >
          > I'll answer this in a separate email.
          >
          > > I think some of this should be in the XML-DBMS
          > > documentation.
          >
          > I've added it as a doc bug.
          >
          > -- Ron
        Your message has been successfully submitted and would be delivered to recipients shortly.