[ 
https://issues.apache.org/jira/browse/TUSCANY-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508457
 ] 

Amita Vadhavkar commented on TUSCANY-1355:
------------------------------------------

Hi lizhantao , I just want to confirm that by saying "create command 
dymanically", what you are
trying is DAS.createCommand(sql) from the client. And in that case, yes, there 
is so far no support
to pass a ResultDescriptor to this command. Only when the Command is specified 
in Config, this is 
possible. We can surely consider this for the next release as an improvement.  
But for the time being,
is it possible to have different commands (all those you intend for dynamic 
creation) in some Config files
to use with current release?

Regards,
Amita


> DAS-RDB does not support Oracle or SqlServer well
> -------------------------------------------------
>
>                 Key: TUSCANY-1355
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1355
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-M2
>         Environment: DAS-RDB to access the database of Oracle
>            Reporter: wangful
>
> I have used the following simple codes to use DAS to access an Oracle 
> database.
>               //String url = 
> "jdbc:db2j:D:/RAD6/runtimes/base_v6/cloudscape/DAS";
>               String url = "jdbc:oracle:thin:wcs/wcs1@//raptor08:1521/g10";
>               String query = "select * from MYCUSTOMER";
>               String query_result="";
>               Connection conn = null;
>       //      Class.forName("com.ibm.db2j.jdbc.DB2jDriver").newInstance();
>               DriverManager.registerDriver(new 
> oracle.jdbc.driver.OracleDriver());
>               conn = DriverManager.getConnection(url);
>               conn.setAutoCommit(false);
>                                            DAS das = 
> DAS.FACTORY.createDAS(conn);
>               Command readStores = das.createCommand(query);
>               DataObject root = (DataObject)readStores.executeQuery();
>               DataObject cus1 = root.getDataObject("MYCUSTOMER[1]");
>               
>               System.out.println(root.getInt("MYCUSTOMER[1]/ID"));
>               System.out.println(root.getString("MYCUSTOMER[1]/NAME"));
> It will caused the following error: 
> Exception in thread "main" java.lang.IllegalArgumentException: Class 
> 'DataGraphRoot' does not have a feature named 'MYCUSTOMER'
>       at 
> org.apache.tuscany.sdo.util.DataObjectUtil.getOpenFeature(DataObjectUtil.java:1804)
>       at 
> org.apache.tuscany.sdo.util.DataObjectUtil.getProperty(DataObjectUtil.java:2367)
>       at 
> org.apache.tuscany.sdo.impl.DataObjectImpl.getProperty(DataObjectImpl.java:1287)
>       at 
> org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.setFeatureName(DataObjectUtil.java:2054)
>       at 
> org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.process(DataObjectUtil.java:2161)
>       at 
> org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.init(DataObjectUtil.java:1940)
>       at 
> org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUtil.java:1860)
>       at 
> org.apache.tuscany.sdo.util.DataObjectUtil.get(DataObjectUtil.java:744)
>       at 
> org.apache.tuscany.sdo.impl.DataObjectImpl.get(DataObjectImpl.java:216)
>       at 
> org.apache.tuscany.sdo.impl.DataObjectImpl.getDataObject(DataObjectImpl.java:326)
>       at TestDAS.main(TestDAS.java:47)
> But the same code and same config will work well for  cloudscape database.
> There are also some other problems for Oracle, seems DAS can't work for 
> oracle.
> Will someone look into this problem?
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to