-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: could not update & Optional feature not implemented
PostPosted: Sun Jul 03, 2005 6:54 am 
Newbie

Joined: Wed Jun 15, 2005 9:49 am
Posts: 12
Hi all,
I want to update a class (User.class), but I get error,and for loading
User.class there is no error.
my DB is MS access.

thanks for any help.
____________
public class App_details extends Action{


public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
{

HttpSession hs= request.getSession( false);

InvAddressForm invAddressForm = (InvAddressForm ) form;

// if (invAddressForm.getInv_address1() != null && invAddressForm.getInv_address2() != null )
{
User user= (User) hs.getAttribute("user");

String inv_address1 = invAddressForm.getInv_address1();
String inv_address2 = invAddressForm.getInv_address2();

user.setInv_address_line1(inv_address1);
user.setInv_address_line2(inv_address2);

UserService.getInstance().updateUser(user);//error
invAddressForm.clear();
}
return mapping.findForward("success");

}

}
____________
public void updateUser(User userInvAddr)
{
Session session = ConnectionFactory.getInstance().getSession();

try
{
session.update(userInvAddr);//error
session.flush();
}
catch (HibernateException e)
{
System.err.println("Hibernate Exception" + e.getMessage());
throw new RuntimeException(e);
}

finally
{
if (session != null)
{
try
{
session.close();
}
catch (HibernateException e)
{
System.err.println("Hibernate Exception" + e.getMessage());
throw new RuntimeException(e);
}

}
}

}

____________
javax.servlet.ServletException: net.sf.hibernate.exception.GenericJDBCException: could not update: [general.User#5]
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
...
java.lang.RuntimeException: net.sf.hibernate.exception.GenericJDBCException: could not update: [general.User#5]
at general.UserService.updateUser(UserService.java:149)
at general.App_details.execute(App_details.java:34)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
...
Caused by: net.sf.hibernate.exception.GenericJDBCException: could not update: [general.User#5]
at net.sf.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:80)
at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)

...
Caused by: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterBigint(JdbcOdbc.java:1179)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setLong(JdbcOdbcPreparedStatement.java:592)
at net.sf.hibernate.type.LongType.set(LongType.java:35)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642)
... 44 more


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 03, 2005 7:06 am 
Newbie

Joined: Wed Jun 15, 2005 9:49 am
Posts: 12
hi all,

type of p.k. in User.hbm and User.java is Long and in DB is "AutoNumber".

<class name="general.User" table="app_customer" >
<id name="customer_id" column="customer_id" type="java.lang.Long" unsaved-value="0">
<generator class="increment"/>
</id>
...

thanks for any help.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 03, 2005 8:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The JDBC-ODBC driver is not a complete implementation. Why not try another database - HSQLDB is a good small footprint database.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 04, 2005 3:47 am 
Newbie

Joined: Wed Jun 15, 2005 9:49 am
Posts: 12
hi,
thanks for helping,
you mean with MS access, it never respond?
and could you introduce a useful link to work with HSQLDB.
and how to create DB in it.

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 04, 2005 3:57 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You should _not_ write database applications if you can't find out the homepage of HSQL DB or how to start it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 04, 2005 11:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Just in case. http://hsqldb.org/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.