You might be getting the IndexOutOfBounds when the query returned 0 elements
and you are trying to access an element from SDO like in your example :
("FM_TEST_CUSTOMER[1]"); I'll take a look in details on your example in the
morning.

--
Luciano Resende
http://people.apache.org/~lresende

On 1/23/07, zhuang johnyson <[EMAIL PROTECTED]> wrote:

Hello,
I have FM_TEST_CUSTOMER.xml:
<Config xsi:noNamespaceSchemaLocation="
http:///org.apache.tuscany.das.rdb/config.xsd"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";>

  <Command name="all customers" SQL="select USER_ID,USER_NAME,PASSWORD
from
FM_TEST_CUSTOMER WHERE USER_ID=2" kind="Select"/>

  <Table tableName="FM_TEST_CUSTOMER" >
    <Column columnName="USER_ID" primaryKey="true" />
    <Column columnName="USER_NAME"/>
    <Column columnName="PASSWORD"/>
  </Table>

  <Table tableName="FM_TEST_ORDER" >
    <Column columnName="ORDER_ID" primaryKey="true" />
    <Column columnName="GOOD_ID"/>
    <Column columnName="PRICE"/>
    <Column columnName="AMOUNT"/>
    <Column columnName="USER_ID" />
  </Table>

    <Relationship name="users" primaryKeyTable="FM_TEST_CUSTOMER"
foreignKeyTable="FM_TEST_ORDER" many="true">
      <KeyPair primaryKeyColumn="USER_ID" foreignKeyColumn="USER_ID"/>
    </Relationship>

</Config>


And my java code:
DAS das = DAS.FACTORY.createDAS(test.getConfig("FM_TEST_CUSTOMER.xml"),
getConnection());
Command selectCommand = das.getCommand("all customers");
DataObject root = selectCommand.executeQuery();
DataObject FM_TEST_CUSTOMER = (DataObject) root.getDataObject
("FM_TEST_CUSTOMER[1]");

When I run this code,The program throws a exception:
Exception in thread "main"

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException:index=0
,
size=0


Reply via email to