I've recently taken a CMP config that had been working with PostgreSQL 
and moved it onto a new install of DB2 v7.1 personal edition (Linux). 
 I've managed to get to the point where the JBoss deployment of my beans 
seems to work (all tables get created), but when I try to create an 
entity instance and write a row to a table, I get the following exception:

javax.ejb.CreateException: Could not create 
entity:COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0100E  Wrong 
number of parameters. SQLSTATE=07001

Turning on JBoss SQL logging, I can see the following going on:

[DB2] Pool DB2 [1/1/10] gave out pooled object: 
org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@5e7e6c6e
[JAWS] Exists command executing: SELECT COUNT(*) FROM Message WHERE id=?
[JAWS] Set parameter: idx=1, jdbcType=BIGINT, value=993053451052
[JAWS] Create command executing: INSERT INTO Message 
(folderID,status,size,content,parent_msgID,ownerID,id) VALUES 
(?,?,?,?,?,?,?)
[JAWS] Set parameter: idx=1, jdbcType=INTEGER, value=0
[JAWS] Set parameter: idx=2, jdbcType=INTEGER, value=0
[JAWS] Set parameter: idx=3, jdbcType=BIGINT, value=16990
[JAWS] Set parameter: idx=4, jdbcType=JAVA_OBJECT, value=NULL
[JAWS] Set parameter: idx=5, jdbcType=BIGINT, value=0
[JAWS] Set parameter: idx=6, jdbcType=INTEGER, value=0
[JAWS] Set parameter: idx=7, jdbcType=BIGINT, value=993053451052
[JAWS] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0100E  Wrong 
number of parameters. SQLSTATE=07001
[JAWS]     at java.sql.SQLException.<init>(SQLException.java:45)
[JAWS]     at COM.ibm.db2.jdbc.DB2Exception.<init>(DB2Exception.java:93)
[JAWS]     at COM.ibm.db2.jdbc.DB2Exception.<init>(DB2Exception.java:111)
[JAWS]     at 
COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:221)
[JAWS]     at 
COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:377)
[JAWS]     at 
COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:355)
[JAWS]     at 
COM.ibm.db2.jdbc.net.DB2PreparedStatement.executeUpdate(DB2PreparedStatement.java:494)
[JAWS]     at 
org.opentools.minerva.jdbc.PreparedStatementInPool.executeUpdate(PreparedStatementInPool.java:82)

The structure of my table is as follows:

db2 => describe table message

Column                         Type      Type
name                           schema    name               Length   
Scale Nulls
------------------------------ --------- ------------------ -------- 
----- -----
FOLDERID                       SYSIBM    INTEGER                   4     
0 Yes 
STATUS                         SYSIBM    INTEGER                   4     
0 Yes 
SIZE                           SYSIBM    BIGINT                    8     
0 Yes 
CONTENT                        SYSIBM    BLOB                   2000     
0 Yes 
PARENT_MSGID                   SYSIBM    BIGINT                    8     
0 Yes 
OWNERID                        SYSIBM    INTEGER                   4     
0 Yes 
ID                             SYSIBM    BIGINT                    8     
0 Yes 

--------

 From this information, everything *looks* correct - JAWS is attempting 
to insert seven parameters, and there are seven columns in the table. 
 All of the datatypes match up.  So why would DB2 be complaining about 
the # of parameters?

A different question: the reason I'm looking at DB2 was that PostgreSQL 
large object operations (inserts in particular) seemed to be terribly 
slow.  Is this a known problem with Postgres?  

Thanks,
Eric



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to