When the database server is down...

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default When the database server is down...

    Is there a way in ColdFusion to make a default page for the ColdFusion server
    to display if the database server is down? That way, users wont be greeted
    with an oracle error...(that is, only for pages where the database needs to be
    accessed)...

    Thanks,
    Frank

    frankjshin Guest

  2. Similar Questions and Discussions

    1. MX 7.01 Server Lockup due to down database
      We have two datasources A) Standard SQL database, in the same domain B) SQL database pulled accross a VPN. Then we have a two load balanced CF...
    2. Flash with Database (MS SQL Server)
      I want my flash (simple loop banner)banner to be connected with MS-SQL Server, so that i can store the counts/banner views by the client. This is...
    3. Connecting to database in different server
      Hi all, I just installed Cold Fusion Developer edition in my PC, and I was wondering whether I can connect it to an Access database that resides...
    4. Is there a way of specify database name alias in the same server?
      Scenario: IDS 9.40 4GL RDS application Linux Redhat 7.3 A unique database server (INFORMIXSERVER=myserver) 3 datatabases with identical...
    5. moving a database from one server to another.
      NT 4.0, IDS 7.3 Hi all I'm moving a small database (4gb) from one server to another as a favour to a mate. I'm savvy with IDS on Unix but have...
  3. #2

    Default Re: When the database server is down...

    > Is there a way in ColdFusion to make a default page for the ColdFusion
    server
    > to display if the database server is down? That way, users wont be
    greeted
    > with an oracle error...(that is, only for pages where the database needs
    to be
    > accessed)...
    Use cftry/cfcatch around the queries.

    --
    <mack />


    Neculai Macarie Guest

  4. #3

    Default Re: When the database server is down...

    you could try .
    <cftry>
    <Cfquery ......>

    </Cfquery>
    <cfcatch type="ANY">
    <cfinclude template="errorpage.cfm">
    </cfcatch>
    </cftry>
    jorgepino Guest

  5. #4

    Default Re: When the database server is down...

    Any idea why this wouldnt work? I am setting dberr to 'bad' if there is a db
    error, but it doesnt seem to fly....

    Frank


    ---------------------





    <CFPARAM name="LoginSubmit" default="">
    <CFPARAM name="i_userid" default ="">
    <CFPARAM name="i_password" default ="">
    <CFPARAM name="dberr" default = 'good'>

    <cftry>

    <CFIF LoginSubmit EQUAL "Login" and i_userid is not "">

    <CFQUERY name="login1" datasource="ds" >
    SELECT USERID, PASSWORD
    FROM users
    WHERE USERID='#i_userid#'
    </CFQUERY>

    <CFIF login1.USERID EQUAL i_userid AND login1.PASSWORD EQUAL i_password>
    <CFSET session.user=i_userid>
    </CFIF>

    </CFIF>

    <cfcatch type="database">
    <cfset dberr is 'bad'>
    </cfcatch>
    </cftry>


    <CFIF session.user EQUAL "unknown">
    <CFOUTPUT>
    <html>
    <title>Page</title>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
    <div align="center">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td colspan="4"><table width="100%" border="0" cellspacing="o" cellpadding="o">
    <tr>
    <td align="left" valign="top" bgcolor="000000">
    <cfinclude template="top.cfm"></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td width="0%" rowspan="2" bgcolor="000000"><img src="shim.gif" height="6"
    width="6"></td>
    <td width="25%" rowspan="2" align="left" valign="top">
    <cfinclude template="left.cfm"></td>
    <td width="83%"><div align="left">Secure Login <br></div></td>
    <td width="0" rowspan="2" bgcolor="000000"><img src="shim.gif" height="6"
    width="6"></td>
    </tr>
    <tr>
    <td align="left" valign="top"><div align="left">
    <form name="login" method="post">
    Data
    <br>
    Please enter your userid and password:

    <cfif dberr is 'bad'>
    The database server is down. Please try again later.
    </cfif>

    <br>
    <br>
    <input type="Text" name="i_userid" size="10">
    <input type="Password" name="i_password">


    <script language="Javascript">
    <!--
    document.login.i_userid.focus();
    // -->
    </script>
    <br>
    <input type="Submit" name="LoginSubmit" value="Login">
    </font>
    </form>
    <br>
    Note: You will be requested to log back in after 15 minutes of inactivity.
    <br>
    </div>
    </td>
    </tr>
    <tr>
    <td bgcolor="000000">&nbsp;</td>
    <td width="25%"> <p><br>
    </p>
    <p>&nbsp; </p></td>
    <td>&nbsp;</td>
    <td bgcolor="000000">&nbsp;</td>
    </tr>
    <tr bgcolor="000000">
    <td colspan="4"><img src="shim.gif" height="6" width="6"></td>
    </tr>
    </table>

    </div>
    <td valign="top" width="1">&nbsp;</td>

    </body>
    </html>
    </CFOUTPUT>


























    <CFABORT>
    </CFIF>








    frankjshin Guest

  6. #5

    Default Re: When the database server is down...

    <cfset dberr is 'bad'>
    <cfset dberr = 'bad'>
    jorgepino Guest

  7. #6

    Default Re: When the database server is down...

    Thanks! All is well now...

    Frank
    frankjshin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139