ibatis sqlserver 存储过程
程序员文章站
2022-06-06 22:42:18
...
ibatis调用sqlserver存储过程: order.xml ?xml version=1.0 encoding=UTF-8?!DOCTYPE sqlMapPUBLIC -//iBATIS.com//DTD SQL Map 2.0//ENhttp://www.ibatis.com/dtd/sql-map-2.dtdsqlMaptypeAlias alias=order type=com.xinrui.pojo.Order /parameterMap id=
ibatis调用sqlserver存储过程:
order.xml
action的function
public String submit_orders() { HttpServletRequest request = ServletActionContext.getRequest(); Order o = new Order(); o.setPid(10000); o.setNotes("aaaaaaaaaaaaaaa"); o.setNums(121); o.setPrice(123.123); o.setUnit("bbbbbbbbbbbbbb"); o.setProid(10000); orderService.addOrders(o); return new Constant().SUBMITING; }
备注:
1.order.xml中,中的?与parameterMap中的parameter顺序相同;
2.javaType为pojo中的变量属性,jdbcType为数据库中对应字段属性;