private void updateDesign ( DataSetDesign dataSetDesign , IConnection conn , String queryText ) throws OdaException { IQuery query = conn . newQuery ( null ) ; query . prepare ( queryText ) ; // TODO a runtime driver might require a query to first execute before // its metadata is available // query.setMaxRows( 1 ); // query.executeQuery(); try { IResultSetMetaData md = query . getMetaData ( ) ; updateResultSetDesign ( md , dataSetDesign ) ; } catch ( OdaException e ) { // no result set definition available, reset previous derived metadata dataSetDesign . setResultSets ( null ) ; e . printStackTrace ( ) ; } // proceed to get parameter design definition try { IParameterMetaData paramMd = query . getParameterMetaData ( ) ; updateParameterDesign ( paramMd , dataSetDesign ) ; } catch ( OdaException ex ) { // no parameter definition available, reset previous derived metadata dataSetDesign . setParameters ( null ) ; ex . printStackTrace ( ) ; } /* * See DesignSessionUtil for more convenience methods * to define a data set design instance. */ }
Updates the given dataSetDesign with the queryText and its derived metadata obtained from the ODA runtime connection .