2 Replies Latest reply on Jun 25, 2004 9:21 AM by Pedro Nevado

    DatabaseServerLoginModule SQL failure: Column Index out of r

    Pedro Nevado Newbie

      I am afraid that this is not a clever question, but I have not found yet an answer.
      With MySql 4.0.18, jdbc driver version 3.0.14 and JBoss 3.2.4, I get the followin excepcion:

      java.sql.SQLException: Column Index out of range ( 2 > 1).
       at com.mysql.jdbc.ResultSet.getString(ResultSet.java:1783)


      with the following two queries in my login module:

      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
       flag="required">
       <module-option name="dsJndiName">java:/mysqlDS</module-option>
       <module-option name="principalsQuery">select password from vivoen.usuario where id_usuario=?</module-option>
       <module-option name="rolesQuery">select id_servicio from vivoen.registro where id_usuario=? AND id_website=1 AND (fecha_fin >= NOW() OR fecha_fin IS NULL)</module-option>
       </login-module>


      I know literally what the exception means, but I am not able to guess why it is thrown in this particular case. Any help about the problem or about any method to find out the actual query that the DatabaseServerLoginModule is using is most wellcome.