Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-190

add a TestSQL property in the struts-config_1_0.dtd for DataSource

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0 Beta 2
    • Fix Version/s: 1.0.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • Bugzilla Id:
      1827

      Description

      Please add this line to the struts-config_1_0.dtd in the datasource section:
      <!ATTLIST data-source testsql CDATA #IMPLIED>

      So that i can specify in the struts_config.xml a testsql value so that my
      implementation of the DataSource can test the connection by sending that sql
      string to it before return the connection to the request.

      Maybe you can set some constraint to as that sql string must return atleast one
      row so because this is done:

      connection = pool.getConnection()
      ResultSet rs = connection.createStatement().executeQuery(sqlTest);
      if(rs.next())
      {
      rs.close();
      // Now the connection is valid and returned:
      return connection;
      }
      // Connection is not valid. Try to make a new one if that fails then throw an
      error.

      johan

        Attachments

          Activity

            People

            • Assignee:
              craigmcc Craig R. McClanahan
              Reporter:
              jcompagner Johan Compagner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: