Announcement Announcement Module
Collapse
No announcement yet.
DB Connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DB Connection

    Hi All,
    i wanted to check whether my application got connected to DB, if not i want show an error message.
    Which is the best place to check this and disply appropriate message.

    Thanks in advance.
    sharath

  • #2
    Any chance you can explain more about what you are trying to do?
    Last edited by karldmoore; Aug 29th, 2007, 11:53 AM.

    Comment


    • #3
      Hi,

      In my application i am rendering homepage by reading entries from a databse.
      If that database is down or couldnt retrive a connection to query. Then i wanted to disply an error message saying that "connection failed!".
      Not only for this home page but through out the application if connection lost or DB goes down proper error message should be displayed.

      Currently i am catching a SQLException in Controller and in that cath block i am rejecting a value using errors.rejectValue(....). With this approach each time if i dip into DB I must catch an SQLException? Or any better approach.

      Thank you
      Last edited by Sharath; Jul 5th, 2007, 08:04 AM.

      Comment


      • #4
        hi,
        IMHO, catching SQLException and populating various error messages shoudl be fine..
        you are already doing what you would like to do.. you can't connect to DB, code raises a SQLException and you act accordingly..

        unless you want some other fancy features.. in that case could you elaborate better what you would like to achieve?

        rgds
        marco

        Comment

        Working...
        X