Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

front end send sql, backend generate and send error message  RSS feed

 
Grace Tan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
Please help me this out! I'm working on servlets(using Apache server). I'm sending sql statement to (dbaccess) database. If I do a sql statement directly at backend, the db will generate an error message. Now I'm sending the query at front end. When error occurs, the backend doesn't show the error message. I have no idea how to 1) generate the error messages at backend when a sql from front end is executed. 2) And then how the backend send the error message to the frontend.
If you have any idea, please help me. I greatly appreciate that!
Regards,
Grace
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Grace Tan:
Dear all,
Please help me this out! I'm working on servlets(using Apache server). I'm sending sql statement to (dbaccess) database. If I do a sql statement directly at backend, the db will generate an error message. Now I'm sending the query at front end. When error occurs, the backend doesn't show the error message. I have no idea how to 1) generate the error messages at backend when a sql from front end is executed. 2) And then how the backend send the error message to the frontend.
If you have any idea, please help me. I greatly appreciate that!
Regards,
Grace

i have experience with iis and sql server, it sounds to me you should throw exception at front end, then catch it at back end.
 
Grace Tan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Liu Don. But what I question was: a sql statement at backend invokes a fully explained error message. Now the same querry is done at frontend. Then I can't get the same error message at backend. How do I get the error message? (The detailed error message is generated at backend)And how this message is passed to the frontend?
Thanks a lot!
 
John Dunn
slicker
Ranch Hand
Posts: 1108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look in the docs or the examples for the jdbc driver that you are using. Will probably have the exact code you need.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!