Thanks for your reply i got a solution to execute the stored procedures that is NamedNativeQuery.
@SqlResultSetMapping(name = "TestMenus") @NamedNativeQuery (name="TestMenu", query="execute Rep_Menu(:fromDate,:toDate)", hint...@queryhint(name="org.hibernate.callable", value = "true")},resultSetMapping="TestMenus") in the DaoHibernate function public List findByNativeQuery(String queryName, Map<String,Object> queryParams) { Query query = (Query) getSession().getNamedQuery(queryName); for (String key: queryParams.keySet()) { query.setParameter(key, queryParams.get(key)); } return query.list(); } but i need one more solution is there any another way to execute the query, why because i need to display the data using displayTag it shows one Object is in one row its not mapping with resultSet column names if any one knows the solution please suggest me.. Anshu Dhamija wrote: > > Hi > I think to call stored procedure you can use > Session session = getSessionFactory().getCurrentSession(); > DelegatingPreparedStatement st = > (DelegatingPreparedStatement)session.connection().prepareStatement("{call > name_of_sp(?,?,?)}"); > st.setString(1,""+a); > st.setString(2, ""+b); > st.setString(3, c); > st.execute(); > > -----Original Message----- > From: sudhakargupta [mailto:sudhakargupta_s...@hotmail.com] > Sent: Tuesday, September 15, 2009 10:41 AM > To: users@appfuse.dev.java.net > Subject: Re: [appfuse-user] how to call Stored procedures in appfuse 2.0 > (MSSQL) > > > Hi Matt, > > i'm using struts in appfuse 2.0, yesterday i got the example for this > one > but it throws not yet implemented exception > > the example is like this > @org.hibernate.annotations.NamedNativeQuery(name = "findByLastName", query > = > "call findByLastName(?, :vLastName)", callable = true, resultClass = > Author.class) > in the daoHibernate class he implemented like this > @SuppressWarnings("unchecked") > public List<Author> findByFirstNameUsingFunction(final String firstName) { > return (List<Author>) getHibernateTemplate().execute(new > HibernateCallback() { > public Object doInHibernate(final Session session) throws > HibernateException, SQLException { > return session.getNamedQuery("findByFirstName") // > .setParameter("vFirstName", firstName) // > .list(); > } > }); > } > > > he given the example for oracle 10g i need to implement it in MSSQL server > and i need to pass more parameters and the resultSet is not related to any > model class. > > please suggest me how to solve this problem its very urgent requirement to > me.. > > > mraible wrote: >> >> What persistence framework are you using? Have you tried looking at that >> framework's documentation? >> >> On Mon, Sep 14, 2009 at 4:41 AM, sudhakargupta < >> sudhakargupta_s...@hotmail.com> wrote: >> >>> >>> Hi Matt, >>> >>> i am working with appfuse 2.0 and MSSQL database. i need to call the >>> stored procedures written in MSSQL. i just want to run the stored >>> procedure >>> with name only, with out writing the function in programming. >>> >>> if you have any examples please give me. >>> please suggest me how to solve this problem. >>> >>> >>> ----- >>> --- >>> Sudhakar >>> -- >>> View this message in context: >>> > http://www.nabble.com/how-to-call-Stored-procedures-in-appfuse-2.0-%28MSSQL% > 29-tp25433619s2369p25433619.html >>> Sent from the AppFuse - User mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net >>> For additional commands, e-mail: users-h...@appfuse.dev.java.net >>> >>> >> >> > > > ----- > --- > Sudhakar > -- > View this message in context: > http://www.nabble.com/how-to-call-Stored-procedures-in-appfuse-2.0-%28MSSQL% > 29-tp25433619s2369p25447885.html > Sent from the AppFuse - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net > For additional commands, e-mail: users-h...@appfuse.dev.java.net > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net > For additional commands, e-mail: users-h...@appfuse.dev.java.net > > > ----- --- Sudhakar -- View this message in context: http://www.nabble.com/how-to-call-Stored-procedures-in-appfuse-2.0-%28MSSQL%29-tp25433619s2369p25506799.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net