Hibernate data insertion not working with oracle auto increment

hi i have created a table and the id is set to auto increment by a sequence trigger pair
when i manually giving value to id its working fine
but when i tried without maually giving the id i am getting this error
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.pojo.Example
at org.hibernate.id.Assigned.generate(Assigned.java:33)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at hibernetsample.Main.main(Main.java:30)

>
hi i have created a table and the id is set to auto increment by a sequence trigger pair
when i manually giving value to id its working fine
but when i tried without maually giving the id i am getting this error
org.hibernate.id.Assigned
>
That is because you are using the hibernate 'assigned' generator which, by definition
>
lets the application to assign an identifier to the object before save() is called.
This is the default strategy if no <generator> element is specified.
>
For your use case you can use the 'sequence' generator.
The valid generator options and one way to use a sequence generator is shown in this article
http://www.hibernate-training-guide.com/identifiers-generators.html
The hibernate section of this article also uses a trigger with sequence generator
http://blog.lishman.com/2009/02/auto-generated-primary-keys-in-oracle.html
You should check the hibernate documention and tutorial for examples or search 'hibernate generator sequence example'

Similar Messages

  • Powerpivot Data Refresh Not working with Oracle Data Source in sharePoint 2013

    I am using SQL Server 2012 PowerPivot for Excel 2010. Getting the following error in SharePoint 2013 environment, when using Oracle data source within a workbook -
    EXCEPTION: Microsoft.AnalysisServices.SPAddin.DataRefreshException: Engine error during processing of OLE DB or ODBC error: The specified module could not be found..:
    <Site\PPIV workbook>---> Microsoft.AnalysisServices.SPAddin.DataRefreshException: OLE DB or ODBC error:
    The specified module could not be found..   
     at Microsoft.AnalysisServices.SPAddin.DataRefresh.ASEngineInstance.ProcessDataSource(String server, String databaseName, String datasourceName, SecureStoreCredentialsWrapper
    runAsCredentials, SecureStoreCredentialsWrapper specificConfigurationCredentials, DataRefreshService dataRefreshService, String fileUrlForTracing)     -
    -- End of inner exception stack trace ---   
     at Microsoft.AnalysisServices.SPAddin.DataRefresh.ASEngineInstance.ProcessDataSource(String server, String databaseName, String datasourceName, SecureStoreCredentialsWrapper
    runAsCredentials, SecureStoreCredentialsWrapper specificConfigurationCredentials, DataRefreshService dataRefreshService, String fileUrlForTracing)   
     at Microsoft.AnalysisServices.SPAddin.DataRefresh.DataRefreshService.ProcessingJob(Object parameters)
    I created a simple Excel 2013 PPIV workbook with an oracle data source and uploaded that to SharePoint 2013, but no change in the results - still getting the above error.
    What is this error? We have installed Oracle client (64-bit, since we use 64-bit Excel and Sp is also 64-bit) on SSAS PPIV Server and SharePoint Content DB Server. Do we need
    to install it anywhere else?
    Thanks,
    Sonal

    Hi Sonal,
    To use PowerPivot for SharePoint on SharePoint 2013, it is required to install PowerPivot for SharePoint with the Slipstream version of SQL Server 2012 SP1. If you install SQL Server 2012 and then use the upgrade version of SQL Server 2012 SP1 to upgrade,
    the environment will not support SharePoint 2013.
    I would suggest you refer to the following articles:
    Install SQL Server BI Features with SharePoint 2013 (SQL Server 2012 SP1):
    http://technet.microsoft.com/en-us/library/jj218795.aspx
    Upgrade SQL Server BI Features to SQL Server 2012 SP1:
    http://technet.microsoft.com/en-us/library/jj870987.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • PreparedStatement not working with Oracle

    Hi All,
    I am using preparedStatement in my JDBC code to fetch/insert values from oracle9i database.
    I am checking condition like if a given record does not exist then insert it else update it.
    First time it works when there is no row in database, however for subsequent run it's not able to return me the result though that row exist in database and this resulting in DuplicateKeyException becuase it try to create the row in db again.
    The code is working fine for MySQL DB2 and SQLServer but doesn't work in case oracle 9i
    Here is mycode
    //problem is here 1st time it works next time it is not retunring true though record is there in DB.
    if(isItemExist("1","CORP"))
    updateItem("1","CORP","DESC1");
    else
    insertItem("1","CORP","DESC1");
    public boolean isItemExist(String itemid, String storeid)
    String FIND_SQL = "SELECT item_desc from item where item_id = ? and store_id = ? ";          
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    rs = ps.executeQuery();
    if(rs.next()){
         return true;
    utils.close(c, ps, rs);
    else{
         return false;
    utils.close(c, ps, rs);
    public void createItem(String itemid, String storeid, String item_desc)
    String INSERT_SQL = "INSERT INTO item(item_id,store_id,item_desc)values(?, ?, ?)";
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, itemid);
    ps.setString(i++, storeid);
    ps.setString(i++, item_desc);
    ps.executeUpdate();
    utils.close(c, ps, null);
    public void updateItem(String itemid, String storeid, String item_desc)
    String INSERT_SQL = "UPDATE item SET item_desc = ?, store_id=? WHERE item_id = ?";
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, item_desc);
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    ps.executeUpdate();
    utils.close(c, ps, null);
    Kindly suggest what's wrong with code. because same code works with other databse like SQL Server, MySQL but it is not working with oracle9i.

    if(isItemExist("1","CORP"))
    updateItem("1","CORP","DESC1");
    else
    insertItem("1","CORP","DESC1");
    String FIND_SQL = "SELECT item_desc from item where item_id = ? and store_id = ? ";
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    String INSERT_SQL = "INSERT INTO item(item_id,store_id,item_desc)values(?, ?, ?)";
    ps.setString(i++, itemid);
    ps.setString(i++, storeid);
    ps.setString(i++, item_desc);
    String INSERT_SQL = "UPDATE item SET item_desc = ?, store_id=? WHERE item_id = ?";
    ps.setString(i++, item_desc);
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);My first guess, looking at the above snippets, would be that the item_id field is a number and not a string and so you should be calling ps.setInt instead of ps.setString when setting that parameter.
    This is only a guess, however, since you have not posted what the actual error is, which will probably give a hint to what the actual error is.

  • Oracle 11g XE not working with oracle BI publisher 10g after enabling ACL

    Hello,
    I previously work with oracle 10gXE and Oracle BI publisher 10g and it work fine. now i install oracle 11g XE and try to configure it with oracle Bi Publlisher, it show this error
    "ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1324 ORA-12570: TNS:packet reader failure" after runing the ACL package to neable network service.
    on the database.
    Please can any body tell be why this is not working. Tanx.

    You'll need to add the apex engine owner to the ACL (Access Control List). Depending on your version of apex the user name varies. i.e. 4.0 is APEX_040000
    See Joel's blog for info about the ACL and APEX.
    [http://joelkallman.blogspot.com/2010/10/application-express-network-acls-and.html]

  • GetObject(int, Map) not working with oracle JDBC

    I'm using Oracle and I'd like to get Date fields as Timestamps since an Oracle date column includes time. I'm trying to use getObject(int, Map) to map the types to Java objects, but it's not working. This is my code:
         public static final HashMap oracleMap = new HashMap();
         static{
              try{
                   oracleMap.put( "DATE", Class.forName("java.sql.Timestamp") );
                   oracleMap.put( "NUMBER", Class.forName("java.math.BigDecimal") );
                   oracleMap.put( "VARCHAR2", Class.forName("java.lang.String") );
                   oracleMap.put( "CLOB", Class.forName("java.sql.Clob") );
                   oracleMap.put( "LONG", Class.forName("java.lang.String") );
              }catch(Exception e){
                   IllegalStateException ise = new IllegalStateException("Oracle type mapping failed.");
                   ise.initCause(e);
                   throw ise;
         }And
                        BASE.println("rs.getClass().getName(): "+rs.getClass().getName());                                        
                        BASE.println("rs.getMetaData().getColumnTypeName(i): "+rs.getMetaData().getColumnTypeName(i));
                        if(rs.getClass().getName().startsWith("oracle")) valObj = rs.getObject(i, DOMTools.oracleMap);                    
                        else valObj = rs.getObject(i);                    
                        BASE.println("valObj.getClass().getName(): "+valObj.getClass().getName());Here's a snippet of my output that illustrates the code not working:
    rs.getClass().getName(): oracle.jdbc.driver.OracleResultSetImpl
    rs.getMetaData().getColumnTypeName(i): DATE
    valObj.getClass().getName(): java.sql.Date
    Anyone know if this is a driver issue? Anyone had luck doing this with Oracle?
    Thanks.

    Well, I'd like it to be java.sql.Timestamp instead of
    java.sql.Date. My actual type is an oracle "DATE".
    Are you saying the Map key for this would be
    "TIMESTAMP" and that by default it maps to
    java.sql.Date? Doesn't seem like that makes sense.I am saying that "TIMESTAMP" is not an oracle value but is instead a JDBC value. Thus it is up to to the driver, not you, to determine what oracle types map to the JDBC type.

  • IPlanet J2EE application not working with oracle 9i but working with 7.3

    We are in a process of upgrading database from oracle 7.3 to 9i.
    We have a working application running on iPlanet Application Server with oracle 7.3 as database. We are using iPlanet Application Server's connection pooling. Our JDBC driver is classes111.zip.
    After upgrading to 9i, our application doesnt work. When I try to run a test application that uses single select statement, this the error I get: java.sql.SQLException: Invalid URL: Driver type not specified
    SQL*PLUS works fine. I havent upgraded oracle client. Do I need to upgrade the JDBC driver or oracle client?
    Any suggestions? iAS version is 6.5.

    If you are new to JSF, then I'd try and simplify the environment in which you are working as the first step to achieving a successful outcome.
    JSF 1.2 is a certified and well tested component of WLS, so we know it works. I'm not sure of the effect of all those additional modules you are adding in there -- it appears as if you have gotten a Faces implementation instantiated, but there could be some form of version difference/conflict since it can't find a method its looking for.
    Using Oracle Enterprise Pack for Eclipse (http://www.oracle.com/technology/software/products/oepe/oepe_11115.html) you can build yourself out a pretty simple JSF application to get started from and deploy it to a WLS server. This would remove all the additional libraries you currently have, provide you with a bundled applicaton to deploy and give you a pretty good environment from which you can learn and experiment with JSF.
    -steve-

  • Netbeans not working with Oracle Waveset 8.1.1!!!!

    We have recently done a test upgrade to Oracle Waveset 8.1.1 and discovered that we can no longer use Netbeans to do further development. We are trying to use Netbeans 6.8 with the 8.1 connector downloaded from the open source java website, which is the last official one available.
    When creating a new IDM project you receive an error saying:
    "The version of the server you are attempting to connect to, 8.1.1,does not match that of the IDE Compatability Bundle for your project,8.1".
    We contacted Oracle and they have advised that we cannot upgrade to 8.1.1, as there is no supported connector. We are getting further advice on this as this is quite bad if its true.
    Is anyone else using Netbeans 6.8 with Oracle Waveset 8.1.1 successfully and if so can you advise how you went about configuring it?

    Update:
    We upgraded our production environment with patch 14 this last Thursday.
    The "sample/ide-bundle.zip" is not located in the download but instead was updated during the patching process and may be found at $WSHOME/sample/ide-bundle.zip.
    After moving the zip to my local machine I was able to configure a (remote) IDM project in Netbeans without receiving an error.
    My problem has been resolved.
    -IDMxml

  • Ankh SVN does not work with Oracle DB Project in ODT 11.1.0.5.10 beta

    I was able to add the new Oracle Database Project to my Subversion repository using TortioseSVN, but unfortunately, the Ankh Source Control options do not appear within Visual Studio and none of the icon overlays appear within Visual Studio.
    Does anyone know any way to get this to work? Does anyone know if this would be an issue with Ankh or with the new Oracle Database Project?
    null

    Yes. Visual C# class projects work just fine with Ankh. It's only the new Oracle Database Project that doesn't have any Ankh menu options or Ankh icon overlays.
    Check out this screenshot of my Visual Studio Solution explorer:
    http://www.mixcollective.com/media/559/oracledbproject.jpg
    You'll see that none of the folders under "Oracle.New" (a new 11.1.0.5.10 beta Oracle Db Project) have the green/read/yellow Ankh icons that indicate the status of the file. Also, none of the repository commit, update, etc options are available when you right click on folders or files in the project.

  • IPhoto change time and date does not work with Flickr

    Hello everyone,
    In my iPhoto librairies, I do change my photo date and time to set them we they were actually taken. Here, I'm refering especially to photos which are:
    * scanned photo
    * stiched photo
    The issue is:
    When I share these photo on Flickr, Flickr sort them with the previous date time setting, even if I have selected to change the original file in iPhoto.
    So it is painful to end up seeing that all the work done on iPhoto is not reflected elsewhere.
    This issue can only be in iPhoto as the old date time should be swapped with the new one.
    Let me know when the fixed will be implemented so I stop loosing precious time editing photos!
    Regards,
    Francois

    I have an Access Database created with Access 2010 installed on a machine running Windows 8 using the Access 2010 Runtime code. For the most part the database works but all reports that require a date in the header come out with ##error. Works fine
    with full access on any other machine. Just this one were we are using Runtime. Any ideas?
    Make sure you don't have Date used as a Field Name, as it is a Reserved Word in Access and can cause unpredictable behavior.
    Also make sure you have compiled the VBA code, before using the Runtime version.
    Have error handling in place, to capture errors in your DB.
    Hope these pointers help,
    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Please vote an answer helpful if they helped. Please mark an answer(s) as an answer when your question is being answered.

  • JavaBean not working with Oracle 9i / Forms 6i

    I have written a Javabean program which I invoke from Oracle Forms. The program is designed to pass a parameter from the form to the bean and get a parameter back to the form from the Javabean. The bean is called on the when-button-pressed event of a form button. The problem is, the form doesnt seem to invoke the bean at all. There seems to be no communcation between the form and the bean at runtime on-click of the form button other that all the messages in the form procedure being displayed.
    The event code for the button is,
    Declare
    setNewMsg varchar2(2000) := 'Hello World';
    getData varchar2(2000);
    BeanHdl Item;
    Begin
    BeanHdl := find_item('Block3.MYBEAN');
    If NOT ID_NULL(BeanHdl) Then
    Message('Before Set');
    SET_CUSTOM_PROPERTY(BeanHdl,1,'setMessage',setNewMsg);
    Message('Before Get');
    getData := GET_CUSTOM_PROPERTY(BeanHdl,1,'getMessage');
    SYNCHRONIZE;
    Message(getData);
    Message('After Get');
    Message(' ');
    Else
    Message('The ID is null');
    Message(' ');
    End If;
    END;
    The javabean code is,
    package oracle.forms.beans;
    import java.awt.*;
    import java.io.*;
    import java.beans.*;
    import oracle.forms.ui.*;
    import oracle.forms.properties.*;
    import oracle.forms.handler.*;
    import oracle.ewt.lwAWT.*;
    public class SimpleTestBean extends VBean {
    public static final ID SETMESSAGE = ID.registerProperty("setMessage");
    public static final ID GETMESSAGE = ID.registerProperty("getMessage");
    private String msg = "";
    public String newMessage() {
    return msg;
    public Object getProperty(ID id) {
    try {
    if (id == GETMESSAGE) {
    return newMessage();
    return super.getProperty(id);
    catch (Exception e) {
    e.printStackTrace();
    return null;
    public boolean setProperty(ID id, Object value) {
    try {
    if (id == SETMESSAGE) {
    msg = (String) value;
    return super.setProperty(id, value);
    catch (Exception e) {
    e.printStackTrace();
    return false;
    -------------------------------------------

    Thanks Duncan,
    The Java Bean in finally getting invoked when the jar file was set in the FORMSWEB.CGF configuration file's archive_jini variable. The console is also up and running.
    I have modified the bean code with the one u sent and put a few console output statements.
    The problem is when this form is invoked from the browser, the console output shows the bean's setProperty method being invoked too many times on-load of the form itself, which goes to the ELSE part of the code. While when-button-pressed event calls the set and get property methods properly.
    This is the console output.
    Oracle JInitiator version 1.1.8.7
    Using JRE version 1.1.8.7
    User home directory = C:\Documents and Settings\Administrator
    Opening http://192.168.11.136:7778/forms60java/oracle/forms/registry/Registry.dat no proxy
    Opening http://192.168.11.136:7778/forms60java/oracle/forms/registry/default.dat no proxy
    connectMode=Socket
    serverHost=192.168.11.136
    serverPort=9001
    Forms Applet version is : 60813
    Inside getProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside getProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty ELSE
    Inside setProperty IF
    Inside getProperty IF
    The bean code is,
    package oracle.forms.beans;
    import java.awt.*;
    import java.io.*;
    import java.beans.*;
    import oracle.forms.ui.*;
    import oracle.forms.properties.*;
    import oracle.forms.handler.*;
    import oracle.ewt.lwAWT.*;
    public class SimpleTestBean extends VBean { 
    public static final ID SETMESSAGE = ID.registerProperty("setMessage");
    public static final ID GETMESSAGE = ID.registerProperty("getMessage");
    private String msg = "";
    public String newMessage() {
         return msg;
         public Object getProperty(ID id) {
                   if (id == GETMESSAGE) {
                        System.out.println("Inside getProperty IF");
                        return newMessage();
                   }else {
                        System.out.println("Inside getProperty ELSE");                
                        return super.getProperty(id);
              public boolean setProperty(ID id, Object value) {
                   if (id == SETMESSAGE) {
                        msg = value.toString();
                        System.out.println("Inside setProperty IF");                     
                        return true;
                   }else {
                        System.out.println("Inside setProperty ELSE");                                         return super.setProperty(id, value);
    Thanks in Advance.

  • Select * from table not working with Oracle OBDC driver

    Hello,
    In our web development we have been using the MS ODBC for Oracle
    driver to connect to our Oracle db. We decided to try the
    Oracle ODBC driver because it supports the commandTimeout
    property in ASP which the MS driver does not. The problem I'm
    running into now is that all of our select * from table
    statements appear not to be working. The Oracle ODBC driver
    version we are using is ver 8.00.05.00. Is there something that
    I'm not doing properly? If I take the same select * from table
    statement and name the columns, I dont get any error. Otherwise
    I'm getting a Subscript out of range error. It seems strange to
    me that this driver would not support a select * from table
    statement (which I''m told is the case by another developer
    here).
    Is there something I'm missing?
    Thanks,
    Pete

    I'm positive I have a connection. Otherwise I wouldn't get a
    response when I name the columns instead of using *.
    There must be something else that I'm missing or doing wrong.
    I've actually been looking into alternative ODBC drivers to see
    if I have the same problems but none that I have found support
    commandTimeout.
    Any other ideas?

  • Query not working with oracle 6i forms

    hello
    i am trying to fetch data through CURSOR in orcle 6i forms.
    i am using follwing query given below
    cursor c1 is
    SELECT EXTRACT("YEAR FROM dateofmtrl") yr
         , SUM(CASE mtrl_flag WHEN 'P' THEN rm1 ELSE -rm1 END) AS opc
         , SUM(CASE mtrl_flag WHEN 'P' THEN rm2 ELSE -rm2 END) AS ppc, 0 AS clinker
    FROM rawmtrl_graph
    GROUP BY EXTRACT(YEAR FROM dateofmtrl)
    order by EXTRACT(YEAR FROM dateofmtrl);-----------
    But it is giving errors............
    Please tell me how to overcome these errors
    thanks in advance for any help....
    With Regards
    Vishal Agrawal

    Dear Vishal,
    CASE statement is not supported in Forms 6i. Instead of CASE statements, use DECODE.
    Regards,
    Manu.

  • JavaBean not working with Oracle Forms (URGENT)

    I have written a Javabean program which I invoke from Oracle Forms. The program is designed to pass a parameter from the form to the bean and get a parameter back to the form from the Javabean. The bean is called on the when-button-pressed event of a form button. The problem is, the form doesnt seem to invoke the bean at all. There seems to be no communcation between the form and the bean at runtime on-click of the form button other that all the messages in the form procedure being displayed.
    The event code for the button is,
    Declare
    setNewMsg varchar2(2000) := 'Hello World';
    getData varchar2(2000);
    BeanHdl Item;
    Begin
    BeanHdl := find_item('Block3.MYBEAN');
    If NOT ID_NULL(BeanHdl) Then
              Message('Before Set');
              SET_CUSTOM_PROPERTY(BeanHdl,1,'setMessage',setNewMsg);
              Message('Before Get');
              getData := GET_CUSTOM_PROPERTY(BeanHdl,1,'getMessage');
              SYNCHRONIZE;
              Message(getData);
              Message('After Get');
              Message(' ');
    Else
              Message('The ID is null');
              Message(' ');
    End If;
    END;
    The javabean code is,
    package oracle.forms.beans;
    import java.awt.*;
    import java.io.*;
    import java.beans.*;
    import oracle.forms.ui.*;
    import oracle.forms.properties.*;
    import oracle.forms.handler.*;
    import oracle.ewt.lwAWT.*;
    public class SimpleTestBean extends VBean { 
    public static final ID SETMESSAGE = ID.registerProperty("setMessage");
    public static final ID GETMESSAGE = ID.registerProperty("getMessage");
    private String msg = "";
    public String newMessage() {
         return msg;
    public Object getProperty(ID id) { 
         try { 
              if (id == GETMESSAGE) { 
                   return newMessage();
    return super.getProperty(id);
    catch (Exception e) { 
         e.printStackTrace();
    return null;
    public boolean setProperty(ID id, Object value) { 
         try { 
              if (id == SETMESSAGE) { 
              msg = (String) value;
    return super.setProperty(id, value);
    catch (Exception e) { 
         e.printStackTrace();
    return false;
    Thanks

    Hi,
         I have written a Javabean program which I invoke from Oracle Forms. The program is designed to pass a parameter from Oracle Form(Ver 6i) to the java bean and get a parameter back to the form. The Javabean is called on "When-Button-Pressed" event of a Form button. The problem is, Form doesn't seem to invoke the bean at all. There seems to be no communication between the Oracle Form and the Javabean at runtime.
         On-click of the Form button though all test messages in the Form trigger are being displayed (Even message before and after the Set_Custom_Property & Get_Custome_Property). The only issue is the Form variable doesn't show the returned value from the bean. So the big question is - Whether the bean is invoked at all or not.
         If YES then how to check it and if NO then how to communicate with the bean from Oracle Form. I am attaching the code of Javabean and trigger code.
    Thanks & Regards
    NOTE : All the ClassPath for the JavaBean has been set properly and the Form is also recognizing the Implementation Class for the Javabean.
         The Trigger Code is,
         --- This code is written on When-Button-Pressed trigger of Form button.
         --- The form also contains the bean area "MYBEAN", which i have referred in the code.
         Declare
              setNewMsg varchar2(2000) := 'Hello World';
              getData varchar2(2000);
              BeanHdl Item;
         Begin
         BeanHdl := find_item('Block3.MYBEAN');
         If NOT ID_NULL(BeanHdl) Then
              Message('Before Set');
              SET_CUSTOM_PROPERTY(BeanHdl,1,'setMessage',setNewMsg);
              Message('Before Get');
              getData := GET_CUSTOM_PROPERTY(BeanHdl,1,'getMessage');
              SYNCHRONIZE;
              Message(getData);
              Message('After Get');
              Message(' ');
         Else
              Message('The ID is null');
              Message(' ');
         End If;
         END;
    The Bean Code is,
         package oracle.forms.beans;
         import java.awt.*;
         import java.io.*;
         import java.beans.*;
         import oracle.forms.ui.*;
         import oracle.forms.properties.*;
         import oracle.forms.handler.*;
         import oracle.ewt.lwAWT.*;
         public class SimpleTestBean extends VBean { 
         public static final ID SETMESSAGE = ID.registerProperty("setMessage");
         public static final ID GETMESSAGE = ID.registerProperty("getMessage");
         private String msg = "";
         public String newMessage() {
              return msg;
         public Object getProperty(ID id) { 
              try { 
                   if (id == GETMESSAGE) { 
                        return newMessage();
    return super.getProperty(id);
         catch (Exception e) { 
              e.printStackTrace();
              return null;
         public boolean setProperty(ID id, Object value) { 
              try { 
              if (id == SETMESSAGE) { 
              msg = (String) value;
    return super.setProperty(id, value);
         catch (Exception e) { 
              e.printStackTrace();
              return false;
    ------------------------------------------------------------------------------------------

  • Jdeveloper 10.1.2.1.0 not working with oracle 8.1.7.4 database

    I migrated my java application using BC4j from Jdeveloper 9.0.3.4 to Jdeveloper 10.1.2.1.0. When I run my BC4j model it runs fine but when I execute the view object using BC4jContext in my action code I am getting following error:
    Error Message: JBO-27122: SQL error during statement preparation. Statement: SELECT OpenOrdersEO.ID, OpenOrdersEO.AGENCY_CLINIC_NAME, OpenOrdersEO.C_O_NAME, OpenOrdersEO.ADDRESS_1, OpenOrdersEO.ADDRESS_2, OpenOrdersEO.CITY, OpenOrdersEO.STATE, OpenOrdersEO.ZIP, OpenOrdersEO.ZIP_4, OpenOrdersEO.ORDER_DATE, OpenOrdersEO.SHIPPED_DATE, OpenOrdersEO.ORDER_STATUS, OpenOrdersEO.B_O_SHIPPED_DATE, OpenOrdersEO.AGENCY_AGENCY_CD, OpenOrdersEO.CREATED_BY, OpenOrdersEO.CREATED_ON, OpenOrdersEO.MODIFIED_BY, OpenOrdersEO.MODIFIED_ON, OpenOrdersEO.ADDRESS_ID, OpenOrdersEO.REJECT_COMMENTS FROM WICFOS.ORDERS OpenOrdersEO WHERE (ID=137)
    Error Message: Invalid column index
    The database I am trying to connect is Oracle 8.1.7.4 which was working fine in Jdev 9 version. Is it because Jdev 10 doesn't support Oracle 8 database. I would appreciate help on this.
    Thanks.

    I migrated my java application using BC4j from Jdeveloper 9.0.3.4 to Jdeveloper 10.1.2.1.0. When I run my BC4j model it runs fine but when I execute the view object using BC4jContext in my action code I am getting following error:
    Error Message: JBO-27122: SQL error during statement preparation. Statement: SELECT OpenOrdersEO.ID, OpenOrdersEO.AGENCY_CLINIC_NAME, OpenOrdersEO.C_O_NAME, OpenOrdersEO.ADDRESS_1, OpenOrdersEO.ADDRESS_2, OpenOrdersEO.CITY, OpenOrdersEO.STATE, OpenOrdersEO.ZIP, OpenOrdersEO.ZIP_4, OpenOrdersEO.ORDER_DATE, OpenOrdersEO.SHIPPED_DATE, OpenOrdersEO.ORDER_STATUS, OpenOrdersEO.B_O_SHIPPED_DATE, OpenOrdersEO.AGENCY_AGENCY_CD, OpenOrdersEO.CREATED_BY, OpenOrdersEO.CREATED_ON, OpenOrdersEO.MODIFIED_BY, OpenOrdersEO.MODIFIED_ON, OpenOrdersEO.ADDRESS_ID, OpenOrdersEO.REJECT_COMMENTS FROM WICFOS.ORDERS OpenOrdersEO WHERE (ID=137)
    Error Message: Invalid column index
    The database I am trying to connect is Oracle 8.1.7.4 which was working fine in Jdev 9 version. Is it because Jdev 10 doesn't support Oracle 8 database. I would appreciate help on this.
    Thanks.

  • Case statement Not working with Oracle version 10g

    Below is code , which works on 11r2 but not on 10g.
    declare
    v1 VARCHAR2(200);
    begin
    select version into v1 from DBA_REGISTRY WHERE COMP_NAME LIKE '%Catalog Views%';
    CASE
          WHEN v1 like '10.2%' THEN
    DBMS_OUTPUT.PUT_LINE('it is  10.2');
    dbms_streams_auth.grant_admin_privilege('GGADMIN');
          WHEN v1 like '11.1%' THEN
    DBMS_OUTPUT.PUT_LINE('it is  11.1');
    dbms_streams_auth.grant_admin_privilege('GGADMIN');
    EXECUTE IMMEDIATE 'grant become user to GGADMIN';
          WHEN v1 like '11.2.0.3%' THEN
    DBMS_OUTPUT.PUT_LINE('it is  11.2.0.3');
    dbms_goldengate_auth.grant_admin_privilege('GGADMIN');
        END CASE;
    end;
    /I dont know when i run code in 10.2 it still looks for dbms_goldengate_auth
    and error out.
    dbms_goldengate_auth.grant_admin_privilege('GGADMIN');
    ERROR at line 18:
    ORA-06550: line 18, column 1:
    PLS-00201: identifier 'DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE' must be declared
    ORA-06550: line 18, column 1:
    PL/SQL: Statement ignoredif I comment dbms_goldengate_auth it returns perfect result.
    it is  10.2
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.03Is there any other way around ????
    Edited by: 949509 on Jan 27, 2013 6:57 PM

    949509 wrote:
    Can you please tell me How i can execute dynamic sql via execute immediate.In a very simialr was as you did the grant of become user in your code. SOmething like:
    declare
       v1          VARCHAR2(200);
       l_grant_str VARCHAR2(1000);
    begin
       select version into v1 from DBA_REGISTRY WHERE COMP_NAME LIKE '%Catalog Views%';
       CASE
          WHEN v1 like '10.2%' THEN
             DBMS_OUTPUT.PUT_LINE('it is  10.2');
             l_grant_str := 'dbms_streams_auth.grant_admin_privilege(''GGADMIN]'')';
          WHEN v1 like '11.1%' THEN
             DBMS_OUTPUT.PUT_LINE('it is  11.1');
             l_grant_str := 'dbms_streams_auth.grant_admin_privilege(''GGADMIN'')';
             EXECUTE IMMEDIATE 'grant become user to GGADMIN';
          WHEN v1 like '11.2.0.3%' THEN
              DBMS_OUTPUT.PUT_LINE('it is  11.2.0.3');
             l_grant_str := 'dbms_goldengate_auth.grant_admin_privilege(''GGADMIN'')';
       END CASE;
       execute immediate l_grant_str;
    end;John

Maybe you are looking for

  • BB MESSENGER- BBM MESSAGES ARE RED CLOCKING AND NEVER SEND

    for a while my phone has been very slow and messages slow att sending but did eventually send/deliver. well one morning when i woke up i discovered my bbm (blackberry messenger) was not working my display picture, status, name wouldnt change and my m

  • Synchronous communication of JDBC adapter with BPM

    Hello XI-Experts, Could you please give me example where BPM is having a Synchronous communication with JDBC adapter?? plz do help. Thanks & Regards, Vanita

  • How to put checkboxes in a Tree list

    Hi All, I have generated a tree structure in my list from a table. The requirement is I have to put checkboxes for the leaves(bottom most level) of the tree. Now the user will be selecting required leaves and thus my logic will continue. Can anyone t

  • Debug Package/Procedure in Oracle

    Hi, Please let me know the procedure to debug a package/procedure in oracle ( Apart from dbms_output commands). We are using Toad. Other option would be to 1. Set tracing on for a particular session and analyze logs generated through tkprof 2. Turn o

  • Is something going on with itune, seems really slow or not working

    iTunes won't refresh or it is really slow today. It has been 2 hrs and I podcast still isn't refresh yet. Work fine yesterday