我用tomcat5.0配数据源时当用looup找jndi报
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class ' ' for connect URL 'null '
这是我在server.xml里的配制
<Resource name= "jdbc/JhsyDB " auth= "Container " type= "javax.sql.DataSource "/>
<ResourceParams name= "jdbc/JhsyDB ">
<parameter>
<name> factory </name>
<value> org.apache.commons.dbcp.BasicDataSourceFactory < alue>
</parameter>
<parameter>
<name> maxActive </name>
<value> 100 < alue>
</parameter>
<parameter>
<name> maxIdle </name>
<value> 30 < alue>
</parameter>
<parameter>
<name> maxWait </name>
<value> 10000 < alue>
</parameter>
<parameter>
<name> username </name>
<value> sa < alue>
<parameter>
<name> password </name>
<value> 123456 < alue>
</parameter>
<parameter>
<name> driverClassName </name>
<value> com.microsoft.jdbc.sqlserver.SQLServerDriver < alue>
</parameter>
<parameter>
<name> url </name>
<value> jdbc:microsoft:sqlserver://localhost:1433/JHSY < alue>
</parameter>
</parameter>
</ResourceParams>
我在web.xml里的配制也没什么问题,
我写的代码
Context ctx=new InitialContext();
DataSource ds=(DataSource)ctx.lookup( "java:comp/env/jdbc/JhsyDB ");
Connection conn = ds.getConnection();
Statement stmt =conn.createStatement();
哪位能告诉我为什么吗?谢谢了
------解决方案--------------------
<value> jdbc:microsoft:sqlserver://localhost:1433/JHSY < alue>
<value> com.microsoft.jdbc.sqlserver.SQLServerDriver < alue>
</value> 关闭处是手误?
------解决方案--------------------
tomcat已经把我搞疯老
见此帖,也没解决
http://community.csdn.net/Expert/topic/5458/5458326.xml?temp=.4853327
------解决方案--------------------
<parameter>
<name> driverClassName </name>
<value> com.microsoft.jdbc.sqlserver.SQLServerDriver < alue>
</parameter>
改成
<parameter>
<name> driverClass </name>
<value> com.microsoft.jdbc.sqlserver.SQLServerDriver < alue>