Search code examples
oraclejdbcjstlwebsphere

JSTL SQL setDataSource not working with Webshpere 8.5


<sql:setDataSource var="TCIT" scope="application"
        driver="${driver}" 
        url="${url}"
        user="${username}"
        password="${password}" />

The above code is used in a legacy application deployed in OC4J that is being migrated to WebSphere 8.5. The properties in {} above are fetched from a property file. Ensured the values are coming correctly form there. However, when the database connection is created the application is encountering the following exception: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver" . I have the ojdbc14.jar in the WEB-INF/lib folder, still facing the issue.


Solution

  • Finally the issue got resolved creating a JDBC connection pool at Application server level. Turns out Websphere does not allow the connection to be created using the above method. Below is the modified tag that is using JNDI lookup for accessing the JDBC connection pool at application level.

    <sql:setDataSource var="connPool" scope="application" dataSource="${jndi.devPool}"/>