我是用jbuilder自带的tomcat配置的连接池,所有的文件都配置过,可是运行后会出现这个问题
Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"--------怎么解决,大家来看看,解决不了毕业设计就完不成了。
我的server.xml的配置
<Resource
name="jdbc/TestPool"
type="javax.sql.DataSource"
username="sa"
password="123456"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Test"
maxIdle="10"
maxActive="20"
maxWait="-1"/>
context.xml的配置
<ResourceLink
name="jdbc/TestPool"
type="javax.sql.DataSource"
global="jdbc/TestPool"/>
web.xml的配置
<resource-ref>
<res-ref-name>jdbc/TestPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
我的代码是
<sql:setDataSource var="example1" dataSource="jdbc/TestPool"/>
<sql:query var="query1" dataSource="${example1}">select * from test</sql:query>
<table>
<c:forEach var="rows" items="${query1.rows}">
<tr>
<td>
ID: <c:out value="${rows.ID}"/></td>
<td>Pname:<c:out value="${rows.Pname}"/></td>
</tr>
</c:forEach>
</table>
Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"--------怎么解决,大家来看看,解决不了毕业设计就完不成了。
我的server.xml的配置
<Resource
name="jdbc/TestPool"
type="javax.sql.DataSource"
username="sa"
password="123456"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Test"
maxIdle="10"
maxActive="20"
maxWait="-1"/>
context.xml的配置
<ResourceLink
name="jdbc/TestPool"
type="javax.sql.DataSource"
global="jdbc/TestPool"/>
web.xml的配置
<resource-ref>
<res-ref-name>jdbc/TestPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
我的代码是
<sql:setDataSource var="example1" dataSource="jdbc/TestPool"/>
<sql:query var="query1" dataSource="${example1}">select * from test</sql:query>
<table>
<c:forEach var="rows" items="${query1.rows}">
<tr>
<td>
ID: <c:out value="${rows.ID}"/></td>
<td>Pname:<c:out value="${rows.Pname}"/></td>
</tr>
</c:forEach>
</table>
解决方案 »
- java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang
- 上传的文件可以以何种类型存进数据库呢?
- 一个关于页面中框架(framese)中frame跳转的问题,请问是tomcat服务器响应的页面,还是客户端直接从<frame>中的src中取的页面
- 求一段代码
- 快"宋"外卖营业前意见大征集
- 如何才能学好Java,欢迎大家交流!
- 吐血求jsp下载网站的源码!!!
- 在JAVASCRIPT中取余数用什么函数?
- 在文件的下载后存在本地后,文件出现一连串的数字,如何在下载后去掉数字,例:文件是azxs01.zip,下载到本地变成57329847583579azxs01.zi
- 关于tomcat的几个初级问题
- structs的url重写问题
- select * from picture where p_describe like '*"+research+"*'";错了吗!!!
把jdbc驱动的jar复制到 apache-tomcat-x\common\lib下面。