--- Begin Message ---
1. Ask Questions The Smart Way: www.catb.org/~esr/faqs/smart-questions.html
2. Recompile with debug on and step
through AddItemAction
3. Try the Hibernate forum: http://forum.hibernate.org/
-Dennis
"Raghuveer" <[EMAIL PROTECTED]>
02/01/2006 11:01 AM
Please respond to
"Struts Users Mailing List" <user@struts.apache.org> |
|
To
| <user@struts.apache.org>
|
cc
|
|
Subject
| struts + oracle+ hibernate |
|
hi,
Could you help me for Data insertion into Oracle daabase.
I have Table item in scott/tiger database.
With below coe i could retrive data.
But when i save NEW data ,I could not save to my oracle database table.
Experts help !!
-------------------------------
Oracle Database table
---------------------
DROP TABLE ITEM CASCADE CONSTRAINTS ;
CREATE TABLE ITEM (
ID NUMBER (11) NOT NULL,
NAME VARCHAR2 (32) NOT NULL,
DESCRIPTION VARCHAR2 (32) NOT NULL,
CONSTRAINT PKID
PRIMARY KEY ( ID )
USING INDEX
TABLESPACE USERS PCTFREE 10
STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 ))
TABLESPACE USERS NOLOGGING
PCTFREE 10
PCTUSED 40
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 131072
NEXT 131072
MINEXTENTS 1
MAXEXTENTS 4096
FREELISTS 1 FREELIST GROUPS 1 )
NOCACHE;
------------
Item.hbm.xml
----------------
<hibernate-mapping>
<class name="com.edhand.example1.Item" table="item"
>
<id name="id" column="id"
type="java.lang.Long" unsaved-value="0">
<generator class="native"/>
</id>
<property name="name" column="name"
type="java.lang.String" />
<property name="description" column="description"
type="java.lang.String" />
</class>
</hibernate-mapping>
--------------------------------
ERROR
java.lang.RuntimeException: net.sf.hibernate.JDBCException: Could not save
object
at com.edhand.example1.ItemService.addItem(Unknown Source)
at
com.edhand.example1.AddItemAction.execute(Unknown Source)
at
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--- End Message ---
______________________________________________________________
The information in this message is confidential and may be legally privileged.
It is intended solely for the addressee(s). Access to this message by anyone
else is unauthorized. If you are not the intended recipient of this message,
any disclosure, copying, or distribution of it is prohibited and may be
unlawful. If you have received this message in error, please notify the sender
and immediately and permanently delete it and destroy any copies of it that
were printed out. Any opinions or advice contained in this message are
subject to the terms and conditions expressed in any applicable governing
agreement.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]