Differences between revisions 14 and 15
Revision 14 as of 2006-10-02 23:07:05
Size: 1178
Comment:
Revision 15 as of 2009-09-20 22:49:10
Size: 1180
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The RDB DAS uses JDBC [http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSetMetaData.html ResultSetMetadata] to create the set of SDO Types used to construct the data graph returned as a result of a query. JDBC returns the data resulting from a query as a set of rows of column values. The associated !ResultSetMetadata provides information about these values. Table name, column name, column type, etc. are all provided for each returned value. The RDB DAS uses JDBC [[http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSetMetaData.html|ResultSetMetadata]] to create the set of SDO Types used to construct the data graph returned as a result of a query. JDBC returns the data resulting from a query as a set of rows of column values. The associated !ResultSetMetadata provides information about these values. Table name, column name, column type, etc. are all provided for each returned value.

The RDB DAS uses JDBC ResultSetMetadata to create the set of SDO Types used to construct the data graph returned as a result of a query. JDBC returns the data resulting from a query as a set of rows of column values. The associated ResultSetMetadata provides information about these values. Table name, column name, column type, etc. are all provided for each returned value.

For example, consider a database with the following table:

   TABLE CUSTOMER
      ID         INTEGER
      LASTNAME   VARCHAR(20)
      ADDRESS    VARCHAR(30)

The user might query the database like this:

   DAS das = DAS.FACTORY.createDAS(getConnection());
   Command readCustomers = das.createCommand("select * from CUSTOMER where LASTNAME = 'Williams'");             
   DataObject root = readCustomers.executeQuery();                      

The DAS returns a graph of DataObjects each of Type CUSTOMER and each instance will have three properties: (ID, LASTNAME, ADDRESS). Since this example does not pass the DAS a set of SDO Types to use, the DAS creates the Types dynamically based on the ResultSetMetadata.

Tuscany/TuscanyJava/DAS_Java_Overview/RDBDAS_Java_User_Guide/ResultSet-driven_metadata (last edited 2009-09-20 22:49:10 by localhost)