Getting value type at runtime

Hello everyone,
I am using Scanner to get tokens from a buffer. I need to know the type (class) of the value returned. Instead of using "if" statement and hasNext?() for each possible type, is there a method that just return the type. Something like:
Class c = get(String s);So, if s is "Address", c would be set to String.class. If s is "true", c would be set to Boolean.class... etc
Thank you

Yeh, I just saw your other post:
http://forum.java.sun.com/thread.jspa?threadID=783200
The two topics are different but related. The topic, you refer to, are taking about getting a value. In that topic I need a method like:
Object o = String.toObject (String s, Class c);However, the topic "Getting value type at runtime" are taking about getting a type. In this topic I need a method like:
Class c = string.getClass();to return the type this string represents.

Similar Messages

  • Getting value type 20 (plan) from 0CO_OM_OPA* extractor

    Hi All,
    I have 0CO_OM_OPA6 extractor which is for actuals so it extracts value type 10 to bw cube.
    Now as per requirements i need to get value type (0VTYPE) 20 into the cube.
    I know there is extractor 0CO_OM_OPA_3 extractor which is designed for plan. Which are the tables behind this extractor ? can some one give me the names of the tables ?
    is there anyother way i can get value type for plan ?
    Thanks,
    KS

    Please see note note 573962.
    This note returns background information for the totals record and line item DataSources for costs in the area of overhead controlling.
    These are DataSources for objects with an account assignment:
    Cost center,
    Process costs,
    Requests,
    WBS element,
    Network,
    Network activity and
    Network activity element.
    The following questions are answered in this note:
    Why are there two different DataSources that extract costs for an object with an account assignment?
    For which value types do the DataSources return data?
    Which DataSources are delta-compatible?
    When do the line item DataSources sometimes return values for the costs other than the totals records DataSources?
    How do I avoid duplicate values for costs in the InfoCube?
    Which selections should I use with the extraction?
    7000000220000001
    70000003
    Some information is missing.
    70000004
    Why are there two different DataSources that extract costs for an object with an account assignment?
    For which value types do the DataSources return data?
    Which DataSources are delta-compatible?
    Answer
    Totals record DataSources
    There is one totals record DataSource for each of the objects with an account assignment.
    These are specifically the following DataSources: 0CO_OM_CCA_1, 0CO_OM_ABC_1, 0CO_OM_OPA_1, 0CO_OM_WBS_1, CO_OM_NTW_1, 0CO_OM_NWA_1, 0CO_OM_NAE_1.
    The DataSources extract data for the following BW value types, InfoObject
    0VTYPE:
    10 Actual,
    40 Commitment,
    20 Cost element planning values
    at totals record level from the COSS and COSP database tables.
    Furthermore, target costs are still calculated for cost centers from the cost element planning values if the BW value type
    30 Target
    is selected explicitly.
    The totals record DataSources do not support a delta extraction.
    Line item DataSources
    There is also one line item DataSource for each object with an account assignment.
    These are specifically the following DataSources: 0CO_OM_CCA_9, 0CO_OM_ABC_7, 0CO_OM_OPA_6, 0CO_OM_WBS_6, CO_OM_NTW_2, 0CO_OM_NWA_2, 0CO_OM_NAE_2.
    These DataSources only return data for the BW value type
    10 Actual.
    These are actual line items that are read via the COVP view from the COBK and COEP tables.
    The line item DataSources support the delta extraction of data.
    When do the line item DataSources sometimes return values for the costs other than the totals records DataSources?
    Answer
    The actual line item DataSources do not deliver any data from R/3 for historical periods if the line item information for these periods were already archived in R/3. We recommend that you then load the actual data for the historical periods into BW through the totals record DataSources.
    5.     How do I avoid duplicate values for costs in the InfoCube?
    6.     Which selections should I use with the extraction?
    Answer
    During the extraction, make sure that actual data in a certain period is either read through the totals record DataSource or the line item DataSource.
    You can guarantee this by making a corresponding selection for the selection criterion periods for the line items and the totals record DataSources and by restricting the value types for the totals record DataSource.
    If the values of a period are read simultaneously via the totals record and the line item DataSource and these are updated in the InfoCube, this causes duplicate values.
    For old periods, the actual data is usually read at totals record level,
    since the line items are already reorganized or
    because the line items information are no longer required for historical data and, thus, the dataset transferred during the delta initialization of the line items DataSource can reduce.
    Typical example for the selections:
    0CO_OM_CCA_1
    Period : 1995 001   to 2001 016
    Value types: Plan, commitment, target, actual
    0CO_OM_CCA_1
    Period : 2002 001   to 2050 016
    Value types: Plan, commitment, target
    0CO_OM_CCA_9 Delta procedure for actual values
    Period : 2002 001   to 2050 016.
    regards,
    Colin

  • Getting generic type at runtime

    Example:
    public class GenericTest {
    private List<String> list = new List<String>();
    How can I get the type String at runtime?
    Class c = GenericTest.class;
    Field[] fiels = c.getFields();
    for (Field f: fields) {
    Class fc = f.getDeclaringClass();
    // What are the next steps to to get String.class from fc?
    }

    Generic types (ie. the ones inside the < >) get Erased at compile-time. All this type information is therefore not available at run-time
    Google "Java Generics Erasure" to get some more info. (There's a Generics forum by the way!)

  • Get the Type of a generic field at runtime, How to?

    Hello,
    As the topic already says, i need to get the Type of a particular field of a class. This field is declared private and generic. In C# there is a method
    Type Object.getTypeIs there any specific way to do this in Java 1.5?
    Please excuse my poor english.
    Thanks in advance.
    Markus

    McNepp wrote:
    endasil wrote:
    McNepp wrote:
    If you want to know the parametrized type (String in the example), I think there is no way of knowing this in Java 1.5 or Java 1.6, since the parametrized type is erased and not available at run time.The type of a parameterized field is not erased.For most intents and purposes, it is. Type erasure refers to the fact that at runtime, there are not actually multiple class binaries depending on the generic arguments to a class. Therefore, an ArrayList<T> is actually just an ArrayList with no generics.
    Frankly, I don't understand why you insist that the information on generic fields that the OP was asking about is lost at runtime.I wasn't trying to insist that. At the time, I was replying more to Saish and trying to reaffirm that most information about generics is lost at run-time. I mistakenly ignored how you qualified it with "field."
    What you write about instances of generic classes losing their type information is of course correct, albeit not to the point of the original question.Nope, you're right. I was just trying to reconcile the fact that many people get confused that there's any information available at run-time, and so start down the path of thinking that type erasure doesn't exist. But it very much does.
    The original question was about how to obtain the type of a generic field.And I did show in my example that even that is fairly limited, given that if the type is provided by the parameter of the class, it doesn't give you anything useful (I'm not trying to say you said it would!).
    The compiler preservers this information in the class file, so it can be obtained at runtime. Frameworks like JPA put this to use extensively, proving that it is of real value.Definitely. However I don't see this having as much to do with generics as basic reflection functionality. If you can get the type of a field at run-time, you should be able to get the parameters as well! That should in no way belittle its value, though. But I would have guessed (knowing little about) that JPA wouldn't put that to use so much as the type parameters of an accessor return type or mutator argument type. Especially since I thought we'd shown that you would need your fields to be non-private for JPA to be able to gain information about their type.
    Edit: getDeclaredField works fine with private members, and returns the expected "java.lang.String" from jschell's example above
    Edited by: endasil on 28-Apr-2009 10:39 AM

  • Define table type on runtime...Getting Error..

    My requirement is to
    I am trying to define table type on runtime. i.e. ortf_in_table_tbl{noformat}({noformat}i).field_position_rec.ortf_segment_field_name in below code.
    But when I am executing below code and getting below error:
    DECLARE
       CURSOR field_position_cur (p_table_name VARCHAR2)
       IS
          SELECT xosf.field_name, xosf.starting_position, xosf.field_length
            FROM record_types xort, record_segments xors, segment_fields xosf
           WHERE xort.record_type_id = xors.record_type_id
             AND xors.record_segment_id = xosf.record_segment_id
             AND xosf.table_name = p_table_name;
       CURSOR raw_data_cur
       IS
          SELECT *
            FROM raw_data;
       TYPE raw_data_typ IS TABLE OF raw_data_cur%ROWTYPE
          INDEX BY BINARY_INTEGER;
       TYPE table_typ IS TABLE OF emp%ROWTYPE
          INDEX BY BINARY_INTEGER;
       table_tbl      table_typ;
       raw_data_tbl   raw_data_typ;
    BEGIN
       OPEN raw_data_cur;
       LOOP
          FETCH raw_data_cur
          BULK COLLECT INTO raw_data_tbl;
          EXIT WHEN raw_data_tbl.COUNT = 0;
          FOR i IN raw_data_tbl.FIRST .. raw_data_tbl.LAST
          LOOP
             FOR field_position_rec IN field_position_cur ('EMP')
             LOOP
                table_tbl (i).field_position_rec.field_name :=
                   SUBSTR (raw_data_tbl (i).raw_line_text,
                           field_position_rec.starting_position,
                           field_position_rec.field_length
                DBMS_OUTPUT.put_line
                        (   'table_tbl (i).field_position_rec.field_name '
                         || table_tbl (i).field_position_rec.field_name
             END LOOP;
          END LOOP;
       END LOOP;
       CLOSE raw_data_cur;
    FORALL i IN table_tbl.FIRST .. table_tbl.LAST
          INSERT INTO emp
               VALUES (table_tbl (i)
       COMMIT;
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line ('OTHERS ' || SQLERRM);
    END;
    **ORA-06550: line 61, column 52:**
    **PLS-00302: component 'FIELD_POSITION_REC' must be declared**
    **ORA-06550: line 54, column 13:**
    **PL/SQL: Statement ignored**Here field_position_cur is giving me column name for the EMP table (i.e. field_position_rec.field_name) and field_position_cur is giving start and length to derive value of the that column
    i.e.
    SUBSTR (raw_data_tbl (i).raw_line_text,
                           field_position_rec.starting_position,
                           field_position_rec.field_length
                          )But it is giving me error. We are on 10g database.
    Please suggest the solution to it.
    Edited by: BluShadow on 12-Jan-2012 08:21
    added {noformat}{noformat} and other tags to make it readable.  Please read {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    piyushgupta wrote:
    My requirement is to
    I am trying to define table type on runtime. Please explain - it is not clear from the code what you are attempting.
    Also note that PL/SQL is strong typed language. This mean that you cannot define a variable using a weak type and at runtime change that into a formal data type.
    In Oracle, the abstract AnyData data type can be used for unknown data types - and methods exist that allows different data types to be stored and retrieved as AnyData types. Of course, there are overheads involved in using an abstract data type (implemented as an object class) like this.
    Another method is to use DBMS_SQL to create dynamic code (SQL or PL/SQL) - and perform dynamic binding (the bind determines the data type of the bind variable in the code). If the dynamic code is a SQL select, the describe interface enables you to determine the content (columns and data types) of the SQL projection.
    The final method that comes to mind is using a RTTI (Run Time Type Information) interface - something that is also supported by Oracle (and basically the backend implementation of answering a describe interface call). This is however a bit more complex and quite specialised and needs a very unique problem to justify it being used.

  • How to get values from a stored package variable of type record ?

    Sir,
    In my JClient form, I need to get values from a database stored package variable of type record. And the values are retained in the JClient form for the whole session. The values are copied only once when the form is started.
    What is the best way to do that ?
    Thanks
    Stephen

    Stephen,
    not sure what your model is, but if it is Business Components, I think I would expose the properties as a client method on the application module. This way all JClient panels and frames will have access to it. You could use a HashMap to store the data in teh app module.
    If JDBC supports the record type, then you should be able to call it via a prepared SQL statement. If not, you may consider writing a PLSQL accessor to your stored procedure that returns something that can be handled.
    Steve Muench provides the following examples on his blog page
    http://otn.oracle.com/products/jdev/tips/muench/stprocnondbblock/PassUserEnteredValuesToStoredProc.zip
    http://otn.oracle.com/products/jdev/tips/muench/multilevelstproc/MultilevelStoredProcExample.zip
    Frank

  • Transaction Type field not getting value in F-05 transaction

    Hi All,
    When ever we are doing a reverse posting for foreign currency valuation using F.05 Tcode it will create a BDC session where we can execute this batch Input session thru SM37.
    This will use F-05 Tcode to post the the entries, but the problem is one of  the field Transaction Type is not getting value for some of the GL account numbers range. This is totally SAP standard program take cares of it. Transaction type field value shuld be populated by '990' value for this GL account range, this is fixed. So is thr any User exit or Screen exit for this Tcode or how we can populate the value....
    Help me...
    Chandar
    Edited by: Bala Chandar on Feb 12, 2009 1:25 PM
    Edited by: Bala Chandar on Feb 12, 2009 1:28 PM
    Edited by: Bala Chandar on Feb 12, 2009 1:33 PM

    Hi Mr/Mrs Bala Chander,
    I am having the same problem.
    When running F.05 a BIM is created for GL account X. GL account X has a field status in which transaction type is defined as a required field because of BCS / ECCS. We have a substitution rule in place which should default the transaction type, based on several criteria. But when executing the BIM, I see that nothing is filled in field transaction type. Did you find a proper solution for your problem? Changing the field status is not an option in my opinion.
    Regards,
    Joep

  • BAPI function module to get condition type and its values based on delivery number?

    Hi All,
    I would like to have the BAPI function module to get condition type value based on delivery number before invoice is created.please provide detail program for as a reference .please reply as soon as possible its urgent.
    Regards,
    saaikumar.

    If you haven't already, you may first need to search via the SAP transaction "BAPI" in the area this is applicable to.  Failing that I do hope you get an answer.

  • Want to get "Base Type" value in Delivery

    Hi,
    I would like to get  "Base Type" value when create Delivery (Copy from Sales Order).
    The following is my code:
    Dim oOrderMat As SAPbouiCom.Matrix
    Dim oColumns As SAP bouiCom.Columns
    Dim oKeyColumn As SAPbouiCOM.Column
    Dim oKeyValue As String
    oOrderMat=oForm.Items.Item("38").Specific
    oColumns=oOrderMat.Columns
    For i=1 to oOrderMat.RowCount()-1
    oTypeColumn=oColumns.Item("43")
    oTypeValue=oTypeColumn.Cells.Item(i).Specific.Value()
    However, when i use the same way to retrieve the value of "Base Key" or "Base Row" which is perfectly fine.  The following is the error message.
    Error Message:
    error: System.MissingMemberException:Public member 'value' on type 'IComboBox' not found.
    at
    Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o,Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
    at
    Project1.CatchingEvents.SBO_Applicaton_FormDataEvent(BusinessObjectInfo&BusinessObjectInfo,Boolean&BubbleEvent)in
    Please help
    Regards,
    Anna

    Hi Anna,
    looks like that column is a combobox
    try:
    oTypeValue=oTypeColumn.Cells.Item(i).Specific.Selected.Value
    lg David

  • How works Get Property Value / Type Automatic?

    Hi,
    I need to get in Labview some variables from Teststand. The VI I wrote use "Get Property Value" from Teststand and works fine... when I specify the type of variable I whant from Teststand (Boolean, I32,...).
    But I need a VI which retrieve the value of my variable independently of the variable type.
    I tried to set the type option "Automatic" but the "Get Property Value" always give back an empty array of boolean....
    How works the "Automatic" option by the "Get Property Value"?
    Is there a possibility in Labview to get the type of a Teststand variable?
    Cheers,
    Risotto

    Risotto,
    the "automatic" feature is no feature but an entry made because of the
    polymorphic design of the "get property value" VI. if you would change
    the order of the VIs contained in the polymorphic VI, you would
    retrieve other kind of values.
    therefore never use the automatic setting of this VI. the
    simplest way to solve such thing is to pass the data in variant and an
    additional numeric value for identifying the type of the value.
    Norbert B.
    - NI Germany
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to get value from ___.co.xml ???

    Hi All,
         I am trying to deveop a KM service that should be configurable(by the User) so that he/she can specify the folder on which the service should act on...
    I have created a CM repository called "<b>test_Rep</b>" for my purpose and added my rep. service to it. Guess what! The uploaded documents are getting renamed .. HURRAY!!!!!!!!!
    i changed the
    ___.co.xml
    and
    ___.cc.xml
    files by adding another parameter!
    After editing the XML files, i have tried to read the properties in the received() method as follows :
    String repositoryPath = this.properties.getProperty("myFolder");
    <b>It works!</b>
    Original value of myFolder (in co.xml file) = /test_Rep/folder1
    <Configurable .....>
    <property name="myFolder" value="/test_Rep/folder1" />
    </Configurable>
    But, in PORTAL when i change, System Admin >> System config >> Content management >> rep. services >> com.test.SampleService >> myFolder = <b>"/test_Rep/folder2"</b>, and try to check in that folder... it doesn't work .. 
    I even restarted the server .. but, doesn't help!
    <b><u>Doubts:</u></b>
    1) when the user changes the value of 'myFolder' (in  content mgt >> rep. services >> com.test.SampleService), does it change the XML file inside the par file?????
    2) How should i retrieve the value of this parameter at runtime (the latest value which the user entered in  content mgt >> rep. services >> com.test.SampleService)
    please see the below code of received(IEvent event) method:::::
    private static final Location log = Location.getLocation(SampleService.class );
    public void received(IEvent event) {
      IResourceEvent myEvent = (IResourceEvent) event;
      IResource resource = (IResource) myEvent.getParameter();
      String repositoryPath = this.properties.getProperty( "myFolder");     //getting folder name at runtime!!!!!!!
      String parentPath = "";
      try {
         parentPath = resource.getParentCollection().getRID().toString();
      } catch (AccessDeniedException e1) {
         e1.printStackTrace();
      } catch (ResourceException e1) {
         e1.printStackTrace();
         if (resource != null && (!resource.isCollection()) ) {
         try {
         /* my business logic...
         } catch (NotSupportedException e) {
              log.errorT("Got exception: Not Supported Exception!" );
         } catch (ResourceException e) {
              log.errorT("Got exception: Resource Exception!" );
    plz help..
    Any ideas on this scenario ..
    Regards,
    Krish.

    Hi,
    you don't have to create a ConfigListener. But if you want it - you can. Have you noticed in another sections of CM configuration that you do not have to restart the J2EE to apply changes?
    In your *.cc.xml you can define it by adding the <i>hotReload, hotLoad, hotUnload</i> attributes. See my example:
    <ConfigClass
         id="name"
         name="NewDocuments"
         hotReload="true"
         hotUnload="true"
         advanced="false"
         hotLoad="true"
         configurable="cz.sap.szif.newDocuments.handler.EventHandlerService" >
                <attribute name="name" type="string" mandatory="true"  visibleColumn="true"/>      
              <attribute name="replicator" type="boolean" mandatory="true" default="false"/>              
    </ConfigClass>
    Now create an implementation of IConfigListener interface (something like this):
    public class NewDocumentsServiceConfig implements IConfigEventListener {
      // plugin definition
      private static final String PLUGIN_NEW_DOCUMENTS = "/cm/customer";
      private static final String CONFIGCLASS_NEW_DOCUMENTS = "NewDocuments";
      private static final String readPlugins[] = { PLUGIN_NEW_DOCUMENTS };
      // config data
      private List configList = null;
       * constructor
      public NewDocumentsServiceConfig() {
        try {
          // read initial data
          reconfigure();
          // register event listener for my configuration
          Configuration.getInstance().getConfigEventServiceInstance().addConfigEventListener(
            this,
            readPlugins);
        } catch (Exception e) {
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
       * call before object destroy
      public void destroy() {
        try {
          // unregister listener
          Configuration.getInstance().getConfigEventServiceInstance().removeConfigEventListener(this);
        } catch (InitialConfigException e) {
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
        } catch (Exception e) {
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
      /* (non-Javadoc)
       * @see com.sapportals.config.event.IConfigEventListener#getConfigListenerId()
      public String getConfigListenerId() {
        return toString();
      /* (non-Javadoc)
       * @see com.sapportals.config.event.IConfigEventListener#configEvent(com.sapportals.config.event.ConfigEvent)
      public void configEvent(ConfigEvent event) {
        // this is a simple example
        // if an event occurs - reconfigure == re-read all configurations
        // ...you could catch which configuration was changed and only change the config for only this one
        try {
          if (event.getType() != ConfigEvent.CONFIGURABLE_LOADED
            && event.getType() != ConfigEvent.CONFIGMANAGER_TERMINATED)
            reconfigure();
          LogWriter.traceInfo(LogWrapper.trace, " event:" + event.getType());
        } catch (Exception e) {
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
       * Reload all the configurations
      private void reconfigure() {
        try {
          IConfigClientContext context = IConfigClientContext.createContext(ConfigCrutch.getConfigServiceUser());
          IConfigManager cfg = Configuration.getInstance().getConfigManager(context);
          IConfigPlugin configPlugin = cfg.getConfigPlugin(PLUGIN_NEW_DOCUMENTS);
          this.configList = new LinkedList();
          if (configPlugin != null) {
            LogWriter.traceInfo(LogWrapper.trace, " configPlugin:" + configPlugin.getName());
            IMutableConfigurable[] configurables =
              configPlugin.getConfigurables(CONFIGCLASS_NEW_DOCUMENTS, false);
            for (int j = 0; j < configurables.length; j++) {
              IMutableConfigurable configurable = configurables[j];
              if (configurable.getConfigClass().getName().equals(CONFIGCLASS_NEW_DOCUMENTS)) {
                // this is a simple object which holds the attribute values
                // in a HashMap (hMap.put(PROP_NAME, configurable.getPropertyValue(PROP_NAME));...)
                NewDocumentsConfigRecord record = new NewDocumentsConfigRecord(configurable);
                this.configList.add(record);
          } else {
            LogWriter.traceWarning(
              LogWrapper.trace,
              " configPlugin == NULL for pluginName:" + PLUGIN_NEW_DOCUMENTS);
        } catch (InitialConfigException e) {
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
        } catch (Exception e) {
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
       * @return all my configurations
      public List getConfigList() {
        return this.configList;
    ...and in your service:
    public class EventHandlerService extends AbstractService implements IEventHandlerService {
      private NewDocumentsServiceConfig config_listener;
      public void afterInit() {
        // setup config listener
        config_listener = new NewDocumentsServiceConfig();
      public void release() {
        config_listener.destroy();
        config_listener = null;
    Now you should be able to catch the changes in the configuration.
    Hope this helps,
    Romano

  • Creating a simple type in runtime

    Hi,
    I'd like to know if it's possible to create a simple type in runtime, and set its constraints.
    I need to do that because I generate UIElements at runtime, and I'd to parameter the type of the attribute bound to that UIElement at runtime.
    I won't know the number of UIElements and their type definitions until I go get them from the backend.
    Is it possible, or I'll have to resolve that through a workaround?
    Thanks in advance.
    Alexis Trudeau

    Hi Alexis,
    it's not possible to create a SimpleType at runtime, but it is possible to modify one. Everything can be changed except the builtin-type, which basically describes the Java class used to store values for this type.
    So you can create your attributes using the predefined SimpleType for your desired class and then call
    getModifiableSimpleType()
    on that attribute. Then you can set the constraints as needed.
    HTH Uwe

  • "Cannot get parameter type" exception in logs

    Hello, Everyone!
    I am trying to migrate my old Birt reports to a new runtime version (and new designing capabilities as well). The reports get rendered correctly after migration but I experience some lack of performance (quite significant actually). When I check logs I see lots of SEVERE exceptions concerning report parameters which probably affect the delay.
    Technical parameters:
    Database: Oracle 11g
    AS: Apache Tomcat 7.0.26
    Java: 1.7.0_67
    JDBC Driver: ojdbc6.jar or ojdbc7.jar (described below)
    old Birt Viewer Runtime version: 2.5.2
    new Birt Viewer Runtime version: 4.4.2 (the latest)
    The exceptions are following:
    Apr 07, 2015 7:55:40 PM org.eclipse.birt.data.engine.odaconsumer.PreparedStatement doSetNull( int )
    SEVERE: Cannot set a null value to parameter 147.
    org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
    SQL error #1:Unsupported feature
    java.sql.SQLException: Unsupported feature
    at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:884)
    at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setNull(OdaQuery.java:1223)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetNull(PreparedStatement.java:4691)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setNull(PreparedStatement.java:4173)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3113)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
    at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:1159)
    at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:919)
    at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:503)
    at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1222)
    at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233)
    at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:178)
    at org.eclipse.birt.report.engine.data.dte.QueryResultSet.<init>(QueryResultSet.java:98)
    at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:168)
    at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:83)
    at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:275)
    at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1947)
    at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
    at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
    at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
    at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
    at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
    at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
    at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
    at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
    at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:269)
    at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86)
    at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1325)
    at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
    at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
    at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
    at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:191)
    at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:86)
    at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181)
    at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:278)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
    Caused by: java.sql.SQLException: Unsupported feature
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
    at oracle.jdbc.driver.DatabaseError.throwUnsupportedFeatureSqlException(DatabaseError.java:765)
    at oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:156)
    at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:879)
    ... 60 more
    and:
    Apr 07, 2015 7:55:40 PM org.eclipse.birt.data.engine.odaconsumer.ParameterMetaData getRuntimeParameterType
    SEVERE: Cannot get the type for parameter: 1.
    org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot get parameter type.
    SQL error #1:Unsupported feature
    java.sql.SQLException: Unsupported feature
    at org.eclipse.birt.report.data.oda.jdbc.ParameterMetaData.getParameterType(ParameterMetaData.java:161)
    at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaParameterMetaData.getParameterType(OdaParameterMetaData.java:177)
    at org.eclipse.birt.data.engine.odaconsumer.ParameterMetaData.getRuntimeParameterType(ParameterMetaData.java:233)
    at org.eclipse.birt.data.engine.odaconsumer.ParameterMetaData.<init>(ParameterMetaData.java:97)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.mergeParamHintsWithMetaData(PreparedStatement.java:1674)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getParameterMetaData(PreparedStatement.java:1525)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getParameterMetaData(PreparedStatement.java:1539)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getParameterType(PreparedStatement.java:798)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.retrySetParameterValue(PreparedStatement.java:3211)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3188)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
    at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:1159)
    at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:919)
    at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:503)
    at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1222)
    at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233)
    at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:178)
    at org.eclipse.birt.report.engine.data.dte.QueryResultSet.<init>(QueryResultSet.java:98)
    at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:168)
    at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:83)
    at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:275)
    at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1947)
    at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
    at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
    at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
    at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
    at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
    at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
    at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
    at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
    at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:269)
    at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86)
    at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1325)
    at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
    at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
    at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
    at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:191)
    at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:86)
    at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181)
    at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:278)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
    Caused by: java.sql.SQLException: Unsupported feature
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
    at oracle.jdbc.driver.DatabaseError.throwUnsupportedFeatureSqlException(DatabaseError.java:765)
    at oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:156)
    at org.eclipse.birt.report.data.oda.jdbc.ParameterMetaData.getParameterType(ParameterMetaData.java:155)
    ... 65 more
    These exceptions probably refer to dataset (query) parameters rather than to report parameters because of their numbers and total amount.
    The first exception "Cannot set preparedStatement null" seems to be thrown for all parameters that are initially nulls. The second exception "Cannot get parameter type" seems to be thrown for all parameters (twice for some).
    The second one probably has something to do with this bug: https:\//bugs.eclipse.org/bugs/show_bug.cgi?format=multiple&id=384925 Although it is declared to be fixed in an earlier Birt runtime version (4.2.1) and I'm using a later one (4.4.2).
    The first one gets critical if I change the Oracle jdbc driver to the new and the most appropriate one (ojdbc7.jar), which should be a better choice because I have Java 7. Older driver ojdbc6.jar renders the report but writes the exception to the logfile, the newer one produces the following in browser:
    - org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
    AxisFault
    faultCode: BirtRunReportActionHandler.__execute()
    faultSubcode:
    faultString: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
    faultActor:
    faultNode:
    faultDetail:
    stackTrace:org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
    at org.eclipse.birt.report.engine.api.impl.EngineTask.handleFatalExceptions(EngineTask.java:2363)
    at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:277)
    at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86)
    at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1325)
    at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
    at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
    at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
    at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:191)
    at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:86)
    at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181)
    at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:278)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.NullPointerException
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getScaleValue(PreparedStatement.java:4423)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetBigDecimal(PreparedStatement.java:4359)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setBigDecimal(PreparedStatement.java:3955)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.retrySetNullParamValue(PreparedStatement.java:3744)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.retrySetParameterValue(PreparedStatement.java:3245)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3183)
    at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
    at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:1159)
    at org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:605)
    at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:304)
    at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:517)
    at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:346)
    at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:463)
    at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)
    at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)
    at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:178)
    at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:637)
    at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:152)
    at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:83)
    at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:275)
    at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1947)
    at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
    at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
    at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
    at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
    at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
    at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
    at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
    at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
    at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
    at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:269)
    ... 32 more
    For reproducing the situation in the test environment I simply modified standard test.rptdesign and added a datasource and a dataset with one sample parameter:
    <?xml version="1.0" encoding="UTF-8"?>
    <report xmlns="http:\//www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
    <property name="author">Bertie the Platypus</property>
    <property name="comments">Not a very interesting report, just a "Hello World" with a param.</property>
    <property name="createdBy">Eclipse BIRT Designer Version 4.3.2.v20140211-1400 Build &lt;4.3.2.v20140225-1404></property>
    <html-property name="description">Sample report used to test the BIRT viewer.</html-property>
    <property name="units">in</property>
    <property name="layoutPreference">auto layout</property>
    <parameters>
    <scalar-parameter name="sample" id="2">
    <text-property name="displayName">Sample Parameter</text-property>
    <property name="hidden">false</property>
    <property name="valueType">static</property>
    <property name="isRequired">false</property>
    <property name="dataType">decimal</property>
    <property name="distinct">true</property>
    <list-property name="selectionList"/>
    <property name="paramType">simple</property>
    <property name="concealValue">false</property>
    <property name="controlType">text-box</property>
    <structure name="format">
    <property name="category">Unformatted</property>
    </structure>
    </scalar-parameter>
    </parameters>
    <data-sources>
    <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="compl" id="27">
    <list-property name="privateDriverProperties">
    <ex-property>
    <name>metadataBidiFormatStr</name>
    <value>ILYNN</value>
    </ex-property>
    <ex-property>
    <name>disabledMetadataBidiFormatStr</name>
    </ex-property>
    <ex-property>
    <name>contentBidiFormatStr</name>
    <value>ILYNN</value>
    </ex-property>
    <ex-property>
    <name>disabledContentBidiFormatStr</name>
    </ex-property>
    </list-property>
    <property name="odaDriverClass">oracle.jdbc.OracleDriver</property>
    <property name="odaURL">jdbc:oracle:thin:@hawk.insoft03.lan:1521:hawkw</property>
    <property name="odaUser">compl_test</property>
    <encrypted-property name="odaPassword" encryptionID="base64">Y29tcGw=</encrypted-property>
    <property name="odaJndiName">java:comp/env/jdbc/moonDB</property>
    </oda-data-source>
    </data-sources>
    <data-sets>
    <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="test" id="28">
    <list-property name="parameters">
    <structure>
    <property name="name">param_1</property>
    <property name="paramName">sample</property>
    <property name="dataType">string</property>
    <property name="position">1</property>
    <property name="isInput">true</property>
    <property name="isOutput">false</property>
    </structure>
    </list-property>
    <structure name="cachedMetaData">
    <list-property name="resultSet">
    <structure>
    <property name="position">1</property>
    <property name="name">:1</property>
    <property name="dataType">string</property>
    </structure>
    </list-property>
    </structure>
    <property name="dataSource">compl</property>
    <list-property name="resultSet">
    <structure>
    <property name="position">1</property>
    <property name="name">:1</property>
    <property name="nativeName">:1</property>
    <property name="dataType">string</property>
    </structure>
    </list-property>
    <xml-property name="queryText"><![CDATA[select ?
    from dual]]></xml-property>
    <xml-property name="designerValues"><![CDATA[]]></xml-property>
    </oda-data-set>
    </data-sets>
    <page-setup>
    <simple-master-page name="Simple MasterPage" id="3">
    <property name="topMargin">1in</property>
    <property name="leftMargin">1.25in</property>
    <property name="bottomMargin">1in</property>
    <property name="rightMargin">1.25in</property>
    <page-header>
    <grid id="4">
    <property name="width">100%</property>
    <column id="5"/>
    <row id="6">
    <cell id="7">
    <property name="fontSize">xx-large</property>
    <property name="fontWeight">bold</property>
    <property name="textAlign">center</property>
    <text id="8">
    <text-property name="content"><![CDATA[Title]]></text-property>
    </text>
    </cell>
    </row>
    </grid>
    </page-header>
    <page-footer>
    <grid id="9">
    <property name="width">100%</property>
    <column id="10"/>
    <column id="11"/>
    <row id="12">
    <cell id="13">
    <text id="14">
    <property name="contentType">html</property>
    <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
    </text>
    </cell>
    <cell id="15">
    <property name="textAlign">right</property>
    <auto-text id="26">
    <property name="type">page-number</property>
    </auto-text>
    </cell>
    </row>
    </grid>
    </page-footer>
    </simple-master-page>
    </page-setup>
    <body>
    <text id="17">
    <property name="contentType">html</property>
    <text-property name="content"><![CDATA[<b>Congratulations!</b>
    <br><br>
    If you can see this report, it means that the BIRT viewer is installed correctly.
    <br><br>]]></text-property>
    </text>
    <grid id="18">
    <property name="width">100%</property>
    <column id="19">
    <property name="width">1.354in</property>
    </column>
    <column id="20">
    <property name="width">5.083in</property>
    </column>
    <row id="21">
    <cell id="22">
    <label id="23">
    <text-property name="text">Sample Parameter:</text-property>
    </label>
    </cell>
    <cell id="24">
    <data id="25">
    <list-property name="boundDataColumns">
    <structure>
    <property name="name">params["sample"]</property>
    <expression name="expression">params["sample"]</expression>
    </structure>
    </list-property>
    <property name="resultSetColumn">params["sample"]</property>
    </data>
    </cell>
    </row>
    <row id="29">
    <cell id="30">
    <label id="32">
    <text-property name="text">Query result:</text-property>
    </label>
    </cell>
    <cell id="31">
    <data id="33">
    <property name="dataSet">test</property>
    <list-property name="boundDataColumns">
    <structure>
    <property name="name">Column Binding</property>
    <expression name="expression" type="javascript">dataSetRow[":1"]</expression>
    <property name="dataType">string</property>
    <property name="allowExport">true</property>
    </structure>
    </list-property>
    <property name="resultSetColumn">Column Binding</property>
    </data>
    </cell>
    </row>
    </grid>
    </body>
    </report>
    The exceptions raise even in such a simple case. Of course it doesn't take minutes to show, but concerning my report with several datasets taking more than 200 parameters in total, the response time drastically raised from about 30-40 seconds up to 3 minutes.
    So I need help!

    Hello,
    Were you able to solve this problem and how?
    Thanks

  • Getting values from a stored procedure with no parameters

    Hi,
    I'm trying to get values out of a stored procedure that I created on SQL server. I'm trying to get XML values out of the database, but I'm not sure how to get any data out of it written to a file if the procedure doesn't have any parameters.
    So I'm just making a call:
    CallableStatement cs = conn.prepareCall("{call myproc}");
    cs.execute();How do I get values back from this stage?
    Thank you very much,
    Lior

    The short form answer, which assumes that the stored procedure is returning the XML as an out parameter would go something like this.
         public void build(String newUserID, String newPassword) throws SQLException {
              String sql = "{ call GET_ITEM_DETAIL(?, ?, ?, ?, ?, ?) }" ;
              try{
                   init(newUserID, newPassword) ;
                   setCallableStatement(getConnection().prepareCall(sql)) ;
                   getCallableStatement().setInt(1, getItemNumber()) ;
                   getCallableStatement().registerOutParameter(2, oracle.jdbc.driver.OracleTypes.CURSOR) ;
                   getCallableStatement().registerOutParameter(3, oracle.jdbc.driver.OracleTypes.INTEGER) ;
                   getCallableStatement().registerOutParameter(4, oracle.jdbc.driver.OracleTypes.VARCHAR);
                   getCallableStatement().registerOutParameter(5, oracle.jdbc.driver.OracleTypes.VARCHAR) ;
                   getCallableStatement().registerOutParameter(6, oracle.jdbc.driver.OracleTypes.VARCHAR) ;
                   getCallableStatement().execute() ;
                   setSqlResult(getCallableStatement().getInt(3)) ;
                   setSqlMessage(getCallableStatement().getString(4)) ;
                   if( getSqlResult() != 0 ){
                        throw new SQLException(getSqlMessage(), null, getSqlResult()) ;
                   setResultSet((java.sql.ResultSet) getCallableStatement().getObject(2)) ;
                   if( getResultSet() != null ){
                        while( getResultSet().next() ){
                             setItemType(getResultSet().getString("ITEM_TYPE")) ;
                             setItemValue(getResultSet().getString("ITEM_VAL")) ;
                             setDisplayType(getCallableStatement().getString(5)) ;
                             setDisplaySize(Integer.parseInt(getCallableStatement().getString(6))) ;
              catch(SQLException e){
                   java.util.Date now = new java.util.Date() ;
                   java.text.DateFormat format = java.text.DateFormat.getInstance() ;
                   setSqlMessage( e.getClass().getName() + " : " + format.format(now) + " : " + e.getMessage() + " : IN " + getClass().getName() ) ;
                   System.err.println(getSqlMessage()) ;
                   throw e ;
              finally{
                   closeResources() ;
         }The GET_ITEM_DETAIL stored procedure returns several out parameters of various types. The code registers them as out parameters along with an anticipated type and then calls the getXXX(n) method that corresponds with that data type in the appropriate position.
    As I mentioned in my other post, the onus of returning the XML is on the stored procedure, when you get it into Java it's going to be a java.lang.String that you can then parse by whatever means is appropriate to your situation.
    Regards,

  • Help: cant get values from a resultset

    i have a class that contains all my MySQL statement and i am trying to use the results found from one of my select statements to pass on into another class which displays the results in a gui form. Here is my query:
    public void profile(String user)
            try
                 Class.forName(driver);
                 Connection con = DriverManager.getConnection( url,db_user, db_pass);
                 String username, name, email, dob, bio, gender, homepage, number;
                 //find username and select all details
                 String find = "SELECT Username, Full_name, Email, dob, Biography, Gender, Homepage, Contact_number FROM users WHERE Username = ? ";
                 PreparedStatement ps1 = con.prepareStatement(find);
                 ps1.setString(1, user);
                ResultSet rs = ps1.executeQuery();
                while(rs.next())
                    //retreive information from the server
                    username = rs.getString(1);
                    name  = rs.getString(2);
                    email  = rs.getString(3);
                    dob = rs.getString(4);
                    bio = rs.getString(5);
                    gender = rs.getString(6);
                    homepage = rs.getString(7);
                    number = rs.getString(8);
                    User_Profile profile = new User_Profile(username, name, email, dob, bio, gender, homepage, number);
                    JOptionPane.showMessageDialog(null, username + bio + email, null, JOptionPane.ERROR_MESSAGE);
                  con.close();
            catch( Exception e )
                     e.printStackTrace();
                     JOptionPane.showMessageDialog(null, "error," + e.getMessage(), null, JOptionPane.ERROR_MESSAGE);
        }As you can see, i am trying to pass on the variables username, name, etc to a new instance of my user_profile class but it doesnt for some reason. i dont get any comple errors so thats ok. i created messege dialog box from within the while statement above to see if a value is stored, and yes their is a value stored in my variables
    below is the user profile class which shows my constructor that suppose to get the values from the query class in this code entered above       User_Profile profile = new User_Profile(username, name, email, dob, bio, gender, homepage, number);
        protected String username;
        protected String FullName;
        protected String Email;
        protected String DOB;
        protected String Biography;
        protected String Gender;
        protected String Homepage;
        protected String Con_Number;
        protected String crnt_user;
    public User_Profile(String user, String name, String email, String dob,
                                String bio, String gender, String homepage, String number)
            initComponents();
            addWindowListener( this );
            //get values from sql query and store them here.
            this.username = user;
            this.FullName = name;
            this.Email = email;
            this.DOB = dob;
            this.Biography = bio;
            this.Gender = gender;
            this.Homepage = homepage;
            this.Con_Number = number;
         }the code below is used to display one of the values received from the query class, in this case returns null..
    txt_name.setText(username)

    Does the user String match the database String
    exactly?
    Some databases are case sensative.Sorry posted before done.
    Also, ensure you do not have trailing spaces in one or both. I remember Oracle had this problem a few years ago using the Type 4 driver but not through ODBC.

Maybe you are looking for

  • Web sites won't recognize photos added to iPhoto since migrating data

    So, I'm stymied. I haven't seen a solution or question already asked that is precisely like my problem, so I thought I'd just ask it myself. A couple months ago, I did something to bork up the permissions in Lion - if I could be more specific I would

  • About Berkeley I/O.

    I am trying to understand the I/O characteristic of Berkeley DB. Can anyone confirm my observation that Berkeley DB does all the external I/O's (user data, meta data, and anything else) through routines defined in ./src/os/os_rw.cpp? Besides, I measu

  • IMPORT Options in ITUNES:Settings,+16-bit OR 8 Bit??

    I have been importing my store-bought CD's into my ITUNES,..IMPORT SETTINGS>>>>>>>> there are several selections, *AIFF(my favorite),(as I want full, ROBUST-sound (I have the computer space...... *MP3, or *WAV or *Losless... trouble is..I'm getting c

  • Export invoice details of tables

    hi experts , plz tell the export invoice details of tables. thanks Rahul

  • Thread death and xml files when analyzing large datasets

    i analyze large data sets. for example: 4000 persons that each have a time series with 8,000 data points. i do this linearly, so (i think) i am only running the *public static void main(String[] args) { .... }* for(Person person : PersonSet) {  // th