You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by st...@gmail.com on 2006/01/25 11:30:12 UTC

Problem about ibatis query result in JNDI and SIMPLE connection

 Dear Larry,

Now I encountered one strange problem, we got different result in Jndi and
JDBC"simple" connection, the code is following:
      sqlMap.startTransaction();
      querylist=sqlMap.queryForList("PersonInfo.selectAll",role);
      System.out.println(querylist.size());
      ..............
      sqlMap.commitTransaction();

For this query, there are records in database, but in JDBC"JNDI" connection,
it can't get any record, the "querylist.size()" always return 0.
But in JDBC"simple" connection, it can return the correct records, what's
wrong? I think they should return some records.

Following are the congiguration in sql-map-config.xml

JDBC-SIMPLE:
  <transactionManager type="JDBC" >
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver" value="COM.ibm.db2.jdbc.app.DB2Driver"/>
   <property name="JDBC.ConnectionURL" value="jdbc:db2:sbb"/>
   <property name="JDBC.Username" value="db2admin"/>
      <property name="JDBC.Password" value="zaq12wsx"/>
    </dataSource>

JDBC-JNDI
 <transactionManager type="JDBC" >
    <dataSource type="JNDI">
      <property name="DataSource" value="jdbc/sbb"/>
    </dataSource>
  </transactionManager>

Look forward to receiving your reply ASAP.

THanks so much for your warm-hearted help.

Thanks and Best Regards
Steven