Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

843838May 2 2006 — edited May 15 2006
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2006
Added on May 2 2006
5 comments
231 views