Forums Register Login

DataSource invalid: "java.sql.SQLException: No suitable driver"

+Pie Number of slices to send: Send
Hi,

I created a JDBC resource called "jdbc/gms" under SUN JSAS admin. I am trying SQL query using JSTL tag in a JSP page as follows.

<sql:query var="learning" dataSource="jdbc/gms">
Query
</sql:query>

I am getting the error as DataSource invalid: "java.sql.SQLException: No suitable driver".

Instead, If I use the following code it is working properly.
<%
Connection connection = null;
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/gms");
connection=ds.getConnection();
Statement stmt = connection.createStatement();
String sqlquery="My Query";
ResultSet rs = stmt.executeQuery(sqlquery);
%>

I am not sure why JSTL SQL Query is not working. Please help.
Do you pee on your compost? Does this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2298 times.
Similar Threads
DataSource invalid
JBOSS DataSource/Tomcat App - Unable to get connection, DataSource invalid
JSTL SQL and MYSQL connection help.
Trouble in retrieving data from the mysql database using JSTL
JBoss JSTL Datasource issue
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:46:51.