Win a copy of Functional Design and Architecture this week in the Functional programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Executing storedprocedure through HIBERNATE in SPRING

 
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,

I am trying to execute very simple stored procedure using HIBERNATE in SPRING.

I refer this link in javaranch but couldn't solve the problem.

I paste the code snap here one by one:

1)This is my Login.hbm.xml file





2)DaoImplimentation file



3)xxx-servlet mapping file (just part of file)




4)POJO ...
It is having four fields that which i return from stored procedure so i dont include the code.

5)Stored procedure




I am using SQL server 2000...

When i run the application i could login (authentication through database so can connect to DB ) very well.

but getting this exception..



I feel that i am near to solve it..

thanks

Vishal Pandya
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks as though your query is not working quite right. I don't see the issue, but do a google search on "COUNT field incorrect or syntax error". Most of the results point toward a query syntax error.

Best of luck.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I personally, havent used stored proceedures with Hibernate. I looked up the
Hibernate Documentation and it mentioned:


Recommended call form is standard SQL92: { ? = call functionName(<parameters>) } or { ? = call procedureName(<parameters>}.



However, your mapping file has:


{ call test_proc(?) }



Shouldnt this have been



And by the way, as per one of the documents that i saw, the "COUNT field incorrect or syntax error" occurs because

You are trying to insert a record into a database field that has a question mark in its field name.


[ August 30, 2007: Message edited by: Jaikiran Pai ]
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nathan Hook:
It looks as though your query is not working quite right. I don't see the issue, but do a google search on "COUNT field incorrect or syntax error". Most of the results point toward a query syntax error.

Best of luck.



hello Nathan,

Thanks for your suggestion and i did google for it. and i did scan the query syntax again but the same problem persist.

Vishal Pandya
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Jaikiran Pai ,

Thanks for your reply...

1)
I tried the way you suggested { ? = call test_proc() } but getting the same exception.


2)

You are trying to insert a record into a database field that has a question mark in its field name.



I don't have any field containing ? that you would have checked from Login.hbm.xml file.

Vishal Pandya
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends ,

I am also expecting some expert comments from our moderators for ORM Paul Sturrock, Mark Spritzler for this problem.

Thanks,
Vishal Pandya
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic