How using sql tags with a Oracle context


Web tier: servlets, JSP, Web frameworks: How using sql tags with a Oracle context

  1. How using sql tags with a Oracle context (1 messages)

    I recently install Oracle10g and JakartaTomCat and i can run sql statemenst from my JSP page. In fact, i read many webpages examples with MySQL using only the sql tags, making more usefull.

    How can i make it whit Oracle? I need more configuration in server.xml, context.xml or web.xml?

    In web.xml i have this:
            <description>Fuente de datos Oracle10g en servidor linkamarillo</description>

    In $CATALINA_HOME/conf/server.xml:

    In $CATALINA_HOME/conf/context.xml:
    <ResourceLink global="jdbc/oracleInLinkamarillo" name="jdbc/oracleInLinkamarillo" type="javax.sql.DataSource"/>

    I using this code:
    <sql:query var="rs" dataSource="jdbc/oracleInLinkamarillo">
    select id, descripcion, vigencia, periodo from prm_validaciones

      <h2>Results con la etiqueta sql</h2>

    <c:forEach var="row" items="${rs.rows}">
        Clave Id: ${}<br>
        Descripcion: ${row.descripcion}<br>
        Vigencia: ${row.vigencia}<br>
        Periodo: ${row.periodo}

    ... and the result in screen is this:
    Clave Id: ${}
    Descripcion: ${row.descripcion}
    Vigencia: ${row.vigencia}
    Periodo: ${row.periodo}

    How can i use sql tags with a Oracle context?

  2. The JSTL SQL tags work just fine with Oracle see: for example. You might try setting the datasource up directly in the page to make sure that that works - then move on to using a JNDI lookup.