One thing that's certainly wrong is "Person[0]" because an XPath index must be >= 1. See section 12 of the SDO spec: http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1
Note that the code that you said returned what you want is using a property number (i.e., 0): > List l = (List)root.getList(0); To see what the name of this property (number 0) is you can call: ((Property)root.getType().getProperties().get(0)).getName(); Whatever name that returns is the name of the property you should be able to use in the getDataObject() call: "Person" or "PERSON" or whatever, in your example. I'd suggest looking at the SDO spec, or some of the examples, to get a better understanding of how SDO works. Frank. "António Mota" <[EMAIL PROTECTED]> wrote on 06/04/2007 06:55:03 PM: > One last note. If i test with > > List l = (List)root.getList(0); > DataObject d = (DataObject)l.get(0); > String name = d.get(0); > > returns the correct value, what i expected that > > DataObject cust = root.getDataObject("Person[0]"); > String name = cust.getString("LASTNAME"); > > will return. > > Is the problem with the jTDS driver not returning Metadata? > > I don't know what to do now... > > > > 2007/6/4, António Mota <[EMAIL PROTECTED]>: > > Hi: > > > > It seems this error was a "feature" of MS sqlserver driver... I > > changed it to jTDS and it works now. BUT... > > > > now i hav a error on the following line (typical...) > > > > DataObject root = readCustomers.executeQuery(); ---> now works > > DataObject cust = root.getDataObject("PERSON[0]"); ----> gives > error!!!!!!!!!!! > > > > and the error is > > > > Class 'DataGraphRoot' does not have a feature named 'PERSON' > > > > If i try > > > > DataObject cust = root.getDataObject(0); > > > > gives > > > > org.eclipse.emf.ecore.util.EcoreEList$Dynamic cannot be cast to > > commonj.sdo.DataObject > > > > With > > > > DataObject cust = root.getDataObject(1); > > > > i got > > > > java.lang.IndexOutOfBoundsException > > > > > > So what's wrong now? > > > > For a simple test case this is working great :( > > > > Thanks all. > > > > 2007/6/4, António Mota <[EMAIL PROTECTED]>: > > > Hi again: > > > > > > My first try with SDo wasn't encoraging. This very simple example > > > > > > das = DASImpl.FACTORY.createDAS(getConnection()); > > > Command readCustomers = das.createCommand("select * from PERSON"); > > > DataObject root = readCustomers.executeQuery(); > > > > > > gives a error on this last line. The connection is ok because the same > > > sql statement works using jdbc directly. > > > > > > The error is as follows: > > > > > > Exception in thread "main" java.lang.AbstractMethodError: > > > com.microsoft.jdbc.sqlserver.SQLServerConnection. > prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement; > > > at org.apache.tuscany.das.rdb.impl.ConnectionImpl. > prepareStatement(ConnectionImpl.java:98) > > > at org.apache.tuscany.das.rdb.impl.Statement. > getPreparedStatement(Statement.java:199) > > > at org.apache.tuscany.das.rdb.impl.Statement. > executeQuery(Statement.java:53) > > > at org.apache.tuscany.das.rdb.impl.ReadCommandImpl. > executeQuery(ReadCommandImpl.java:61) > > > > > > > > > > > > Help, anyone? > > > > > > -- > > > Melhores cumprimentos / Best regards > > > António Santos Mota > > > > > > > > > -- > > Melhores cumprimentos / Best regards > > António Santos Mota > > > > > -- > Melhores cumprimentos / Best regards > António Santos Mota > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]