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

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0 Beta 2
    • 1.0.0
    • Core
    • None
    • Operating System: All
      Platform: PC
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: