java.sql.SQLException: Parameter index out ofpython rangeindex (1 > number of parameters, which is 0).

问题:java.sql.SQLException: Parameter metadata not available for the given statement
意思说:对于给定语句的参数元数据不可用(连接数据库时的URL需要加上元数据类型)
generateSimpleParameterMetadata=true (生成简单的参数元数据
就解决了。
可能参考什么是数据库的元数据:
/link?url=F8uhezUUTC4aXBrxBQ7b2pgSaSll6xTgEZf1whRK9ycH_buh2ClqLoOoI50RPxKZhM1qR2aehM0YsHzTQmDpY_
&&相关文章推荐
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:366742次
积分:4401
积分:4401
排名:第6259名
原创:141篇
转载:49篇
评论:56条
(6)(6)(10)(7)(14)(7)(6)(3)(10)(2)(8)(2)(7)(4)(4)(5)(4)(3)(2)(5)(2)(3)(6)(4)(4)(1)(7)(8)(4)(4)(1)(1)(3)(7)(5)(6)(1)(3)(1)(2)(3)7818人阅读
The content of element type &sqlMapConfig& is incomplete, it must match &(properties?,settings?,typeAlias*,typeHandler*,transactionManager?,sqlMap+)+&.
(1)The content of element type “sqlMapConfig” is incomplete----&SqlMapConfig.xml 不完整
(2)(properties?,settings?,resultObjectFactory?,typeAlias*,typeHandler*,transactionManager?,sqlMap+)+
此句话的意思就是properties,settings,resultObjectFactory,transactionManager标签可以出现0次或者1次,typeAlias,typeHandler标签可以出现0次或者多次,sqlMap标签至少出现1次。
解决方案:
从解析中我们可以看出,遇到上面的异常我们可以查看的SqlMapConfig.xml文件看我的配置文件中,是否少了以上必不可少的标签。
很容易我们可以看出,是少了sqlMap标签。
在sqlMapConfig.xml文件中增加&
&sqlMap resource=&com\ection\ibatis\Contact.xml&/&
异常2: Error.& Could not set result class.
Exception in thread &main& mon.exception.NestedRuntimeException: Error occurred.
Cause: mon.xml.NodeletException: Error parsing XML.
Cause: mon.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: mon.xml.NodeletException: Error parsing XML.
Cause: mon.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'.
Cause: com.ibatis.sqlmap.client.SqlMapException: Error.
Could not set result class.
Cause: java.lang.ClassNotFoundException: Contact
Caused by: java.lang.ClassNotFoundException: Contact
Caused by: com.ibatis.sqlmap.client.SqlMapException: Error.
Could not set result class.
Cause: java.lang.ClassNotFoundException: Contact
解析:Could not set result class.不能找到设置的resultClass文件
解决方案:
在Contact.xml文件中检查resultClass的路径是否正确。
此时Contact.xml中resultClass路径的配置方式有两种:
(1)第一种方式:
&sqlMap namespace=&Contact&&
&select id=&getAll& resultClass=&com.ection.ibatis.Contact&&
select * from contact
(2)第二种方式:
&sqlMap namespace=&Contact&&
&!-- show all data of table --&
&resultMap class=&com.ection.ibatis.Contact& id=&Contact&&
&result property=&id&/&
&result property=&firstName&/&
&result property=&lastName&/&
&result property=&email&/&
&/resultMap&
&select id=&getAll& resultMap=&Contact&&
select * from contact
&&相关文章推荐
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:87192次
积分:1087
积分:1087
排名:千里之外
原创:20篇
转载:16篇
评论:26条
(1)(1)(1)(2)(10)(2)(1)(2)(4)(2)(4)(6)}

我要回帖

更多关于 mysql range index 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信