从jndi名称空间中获得一个数据源。<br>
<sql:setDataSource
var="example3"
dataSource="jdbc/bn"
/>
读数据:
<sql:query var="query3" dataSource="${example3}">
SELECT * FROM contact
</sql:query>
<table border="1">
<c:forEach var="row" items="${query3.rows}">
<tr>
<td>Name: <c:out value="${row.userName}"/></td>
<td>Value: <c:out value="${row.mobile}"/></td>
</tr>
</c:forEach>
</table>
请问大家是什么原因?
<sql:setDataSource
var="example3"
dataSource="jdbc/bn"
/>
读数据:
<sql:query var="query3" dataSource="${example3}">
SELECT * FROM contact
</sql:query>
<table border="1">
<c:forEach var="row" items="${query3.rows}">
<tr>
<td>Name: <c:out value="${row.userName}"/></td>
<td>Value: <c:out value="${row.mobile}"/></td>
</tr>
</c:forEach>
</table>
请问大家是什么原因?
No suitable driver
这个就是没有驱动包噻
<sql:setDataSource
var="example2"
driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=jspdev;user=sa;password=sa"
/>
是可以运行的,但是通过jnid的方式就是不行
在这里可以找找http://japee.com.cn/jew/bbs.aspx