Problem with DB2 UDB

From: Nikolai Raitsev (nikolai.raitse..mail.com)
Date: Tue Aug 01 2006 - 04:49:23 EDT

  • Next message: Øyvind Harboe: "Re: UUID as primary key"

    Hello all,

    I have a problem running Cayenne with DB2 UDB

    I have a following code:

    Setting connection properties:

    ///
    DataSource dataSource = new PoolManager("com.ibm.db2.jcc.DB2Driver",
    "jdbc:db2://sunlinuxdb2:60000/testjdb", 1, 1, "NRA", "xxx");
    Configuration config = Configuration.getSharedConfiguration();
    DataDomain dataDomain = config.getDomain();

    DataNode dataNode = dataDomain.getNode("DPVWNode");
    dataNode.setDataSource(dataSource);

    ///

    Getting DataContext:
    //
    dataContext = DataContext.createDataContext();

    ///and now run a query:

    SelectQuery selQueryInterface = new SelectQuery("TestClass");
    dataObjectsInInterface = new DataObjectList(dataContext.performQuery
    (selQueryInterface));

    On performQuery i get an exception:
    INFO QueryLogger: --- will run 1 query.
    Exception in thread "main" org.objectstyle.cayenne.CayenneRuntimeException:
    [v.1.2RC1 May 31 2006] Error detecting database type
        at org.objectstyle.cayenne.dba.AutoAdapter.loadAdapter(AutoAdapter.java
    :196)
        at org.objectstyle.cayenne.dba.AutoAdapter.getAdapter(AutoAdapter.java
    :166)
        at org.objectstyle.cayenne.dba.AutoAdapter.getExtendedTypes(
    AutoAdapter.java:276)
        at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java
    :282)
        at org.objectstyle.cayenne.access.DataDomainQueryAction.runQuery(
    DataDomainQueryAction.java:355)

    ... more exceptions

    if i set explicitely a DB2-Adapter like this:

    DataNode dataNode = dataDomain.getNode("DPVWNode");
    dataNode.setAdapter(new org.objectstyle.cayenne.dba.db2.DB2Adapter());
    dataNode.setDataSource(dataSource);

    i get an exception again:

    INFO QueryLogger: --- will run 1 query.
    Exception in thread "main" INFO QueryLogger: *** error.
    com.ibm.db2.jcc.b.SQLException
        at com.ibm.db2.jcc.b.l.a(l.java:1469)
        at com.ibm.db2.jcc.a.bb.h(bb.java:541)
        at com.ibm.db2.jcc.a.bb.g(bb.java:443)
        at com.ibm.db2.jcc.a.bb.d(bb.java:276)
        at com.ibm.db2.jcc.a.bb.d(bb.java:90)
        at com.ibm.db2.jcc.a.b.a(b.java:935)
        at com.ibm.db2.jcc.a.b.a(b.java:450)
        at com.ibm.db2.jcc.a.b.a(b.java:293)
        at com.ibm.db2.jcc.a.b.<init>(b.java:207)
        at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:244)
        at org.objectstyle.cayenne.conn.DriverDataSource.getConnection(
    DriverDataSource.java:151)
    ..... more exceptions

    at application.run.Run.main(Run.java:167)
    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2RC1 May 31 2006]
    Global exception.
        at
    org.objectstyle.cayenne.access.DataDomainQueryAction.nextGlobalException(
    DataDomainQueryAction.java:486)
        at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java
    :297)
        at org.objectstyle.cayenne.access.DataDomainQueryAction.runQuery(
    DataDomainQueryAction.java:355)

    ...more excepions

    what is a problem here?

    i run cayenne with 4 DBMS (MySQL, DB2/As400, Oracle, SQL Server) without
    problems...

    thanks, and best regards,

    Nikolai



    This archive was generated by hypermail 2.0.0 : Tue Aug 01 2006 - 04:49:48 EDT