- 浏览: 105040 次
- 性别:
- 来自: 南京
最新评论
-
gundumw100:
如何不需要账户就能登陆啊?我这边有这个需求,不需要输入用户名和 ...
Apache FtpServer使用讲解 -
aixingjuele:
教训,我也犯了这个错
ORA-01008: not all variables bound -
forcer521:
教训啊!
ORA-01008: not all variables bound -
xingwei4225:
请问楼主,你的数据库连接是在业务层取得的吗?
JDBC分层事务管理机制
# CREATE TABLE "USER_BASIC_INFO"
# ( "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
# "USER_NAME" VARCHAR2(50 BYTE) NOT NULL ENABLE,
# "REAL_NAME" VARCHAR2(50 BYTE),
# "PASSWORD" VARCHAR2(32 BYTE) NOT NULL ENABLE,
# "EMAIL" VARCHAR2(50 BYTE) NOT NULL ENABLE,
# "USER_TYPE" VARCHAR2(50 BYTE),
# "USER_STATE" VARCHAR2(50 BYTE),
# "LOGIN_COUNT" NUMBER(8,0) DEFAULT 0,
# "QUESTION" VARCHAR2(200 BYTE),
# "ANSWER" VARCHAR2(200 BYTE),
# "ACCOUNT" VARCHAR2(50 BYTE) DEFAULT -1,
# "BRANCH_ID" VARCHAR2(50 BYTE) DEFAULT -1,
# "CREATE_DATE" DATE DEFAULT sysdate,
# "MODIFY_DATE" DATE DEFAULT sysdate,
# "LAST_VISIT" DATE DEFAULT sysdate,
# "USER_LEVEL" VARCHAR2(50 BYTE),
# "EXPERIENCE_TIME" NUMBER(4,0) DEFAULT 0,
# "CUSTID" NUMBER(20,0),
# CONSTRAINT "PK_USER_BASIC_INFO" PRIMARY KEY ("USER_ID")
# )
1. CREATE TABLE "USER_EXTEND_INFO"
2. ( "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
3. "SEX" VARCHAR2(50 BYTE),
4. "BIRTHDAY" DATE,
5. "RACE" VARCHAR2(50 BYTE),
6. "PROVINCE" VARCHAR2(50 BYTE),
7. "CITY" VARCHAR2(50 BYTE),
8. "CARD_TYPE" VARCHAR2(50 BYTE),
9. "CARD_ID" VARCHAR2(50 BYTE),
10. "TELEPHONE" VARCHAR2(50 BYTE),
11. "MOBILEPHONE" VARCHAR2(50 BYTE),
12. "FAX" VARCHAR2(50 BYTE),
13. "ADDRESS" VARCHAR2(100 BYTE),
14. "POST_CODE" VARCHAR2(50 BYTE),
15. "DEGREE" VARCHAR2(50 BYTE),
16. "VOCATION" VARCHAR2(50 BYTE),
17. "SOURCE" VARCHAR2(100 BYTE),
18. CONSTRAINT "PK_USER_EXTEND_INFO" PRIMARY KEY ("USER_ID")
19. )
1. create or replace PACKAGE Types
2. AS
3. TYPE ref_cursor IS REF CURSOR;
4. END;
1. create or replace PROCEDURE QUERY_USER_BASIC_INFO
2. ( P_USER_NAME IN USER_BASIC_INFO.USER_NAME % TYPE
3. , P_REAL_NAME IN USER_BASIC_INFO.REAL_NAME % TYPE
4. , P_USER_TYPE IN USER_BASIC_INFO.USER_TYPE % TYPE
5. , P_BRANCH_ID IN USER_BASIC_INFO.BRANCH_ID % TYPE
6. , P_BEGIN_DATE IN DATE
7. , P_END_DATE IN DATE
8. , P_BEGIN IN NUMBER
9. , P_END IN NUMBER
10. , P_RESULT OUT NUMBER
11. , P_CURSOR OUT TYPES.ref_cursor
12. ) AS
13. v_sql varchar2(1000);
14. v_sqlCount varchar2(1000);
15. BEGIN
16. v_sql:='SELECT * FROM (
17. SELECT
18. row_.*,
19. ROWNUM rownum_
20. FROM (
21. SELECT e.*,f.SEX,
22. f.BIRTHDAY,
23. f.RACE,
24. f.PROVINCE,
25. f.CITY,
26. f.CARD_TYPE,
27. f.CARD_ID,
28. f.TELEPHONE,
29. f.MOBILEPHONE,
30. f.FAX,
31. f.ADDRESS,
32. f.POST_CODE,
33. f.DEGREE,
34. f.VOCATION,
35. f.SOURCE,g.key_name FROM USER_BASIC_INFO e left join user_extend_info f on e.user_id=f.user_id
36. left join dictionary g on e.user_type=g.key_code and g.parent_id=11
37. where 1=1';
38. IF P_USER_NAME IS NOT NULL THEN
39. v_sql := v_sql || 'and e.USER_NAME LIKE ' || '''' || P_USER_NAME || '''';
40. ELSE IF P_REAL_NAME IS NOT NULL THEN
41. v_sql := v_sql || 'and e.REAL_NAME LIKE ' || '''' || P_REAL_NAME || '''';
42. ELSE IF P_USER_TYPE IS NOT NULL THEN
43. v_sql := v_sql || 'and e.USER_TYPE = ' || '''' || P_USER_TYPE || '''';
44. ELSE IF P_BRANCH_ID IS NOT NULL THEN
45. v_sql := v_sql || 'and e.BRANCH_ID = ' || '''' || P_BRANCH_ID || '''';
46. ELSE IF P_BEGIN_DATE IS NOT NULL THEN
47. v_sql := v_sql || 'and e.CREATE_DATE between ' || P_BEGIN_DATE || 'and ' || P_END_DATE;
48. END IF;
49. END IF;
50. END IF;
51. END IF;
52. END IF;
53. v_sql := v_sql || ') row_ WHERE ROWNUM <= ' || P_END || ') WHERE rownum_ >' || P_BEGIN;
54. --DBMS_OUTPUT.PUT_LINE(v_sql);
55. open P_CURSOR for v_sql;
56.
57. v_sqlCount := 'SELECT count(1) FROM USER_BASIC_INFO e left join user_extend_info f on e.user_id=f.user_id';
58. IF P_USER_NAME IS NOT NULL THEN
59. v_sql := v_sql || 'and e.USER_NAME LIKE ' || '''' || P_USER_NAME || '''';
60. ELSE IF P_REAL_NAME IS NOT NULL THEN
61. v_sql := v_sql || 'and e.REAL_NAME LIKE ' || '''' || P_REAL_NAME || '''';
62. ELSE IF P_USER_TYPE IS NOT NULL THEN
63. v_sql := v_sql || 'and e.USER_TYPE = ' || '''' || P_USER_TYPE || '''';
64. ELSE IF P_BRANCH_ID IS NOT NULL THEN
65. v_sql := v_sql || 'and e.BRANCH_ID = ' || '''' || P_BRANCH_ID || '''';
66. ELSE IF P_BEGIN_DATE IS NOT NULL THEN
67. v_sql := v_sql || 'and e.CREATE_DATE between ' || P_BEGIN_DATE || 'and ' || P_END_DATE;
68. END IF;
69. END IF;
70. END IF;
71. END IF;
72. END IF;
73. EXECUTE IMMEDIATE v_sqlCount into P_RESULT;
74. EXCEPTION
75. WHEN NO_DATA_FOUND THEN
76. P_RESULT := 9006;
77. WHEN OTHERS THEN
78. P_RESULT := 9005;
79. END QUERY_USER_BASIC_INFO;
1. <?xml version="1.0" encoding="UTF-8"?>
2. <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
3.
4. <!-- iBatis SQL Map 文件 -->
5. <sqlMap namespace="com.cssweb.idm.user.pojo.UserBasicInfo">
6. <typeAlias alias="userBasicInfo" type="com.cssweb.idm.user.pojo.UserBasicInfo"/>
7. <resultMap id="detailMap" class="userBasicInfo">
8. <result property="userId" column="USER_ID" jdbcType="Long"/>
9. <result property="userName" column="USER_NAME" jdbcType="String" nullValue=""/>
10. <result property="realName" column="REAL_NAME" jdbcType="String" nullValue=""/>
11. <result property="password" column="PASSWORD" jdbcType="String" nullValue=""/>
12. <result property="email" column="EMAIL" jdbcType="String" nullValue=""/>
13. <result property="userType" column="USER_TYPE" jdbcType="String" nullValue=""/>
14. <result property="userState" column="USER_STATE" jdbcType="String" nullValue=""/>
15. <result property="loginCount" column="LOGIN_COUNT" jdbcType="java.lang.Integer" nullValue="0"/>
16. <result property="question" column="QUESTION" jdbcType="String" nullValue=""/>
17. <result property="answer" column="ANSWER" jdbcType="String" nullValue=""/>
18. <result property="account" column="ACCOUNT" jdbcType="java.lang.Integer" nullValue="0"/>
19. <result property="branchId" column="BRANCH_ID" jdbcType="String" nullValue=""/>
20. <result property="createDate" column="CREATE_DATE" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
21. <result property="modifyDate" column="MODIFY_DATE" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
22. <result property="lastVisit" column="LAST_VISIT" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
23. <result property="userLevel" column="USER_LEVEL" jdbcType="String" nullValue=""/>
24. <result property="experienceTime" column="EXPERIENCE_TIME" jdbcType="java.lang.Integer" nullValue="0"/>
25. <result property="custId" column="CUSTID" jdbcType="Long" nullValue="0"/>
26. <result property="sex" column="SEX" jdbcType="String" nullValue=""/>
27. <result property="birthday" column="BIRTHDAY" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
28. <result property="race" column="RACE" jdbcType="String" nullValue=""/>
29. <result property="province" column="PROVINCE" jdbcType="String" nullValue=""/>
30. <result property="city" column="CITY" jdbcType="String" nullValue=""/>
31. <result property="cardType" column="CARD_TYPE" jdbcType="String" nullValue=""/>
32. <result property="cardId" column="CARD_ID" jdbcType="String" nullValue=""/>
33. <result property="telephone" column="TELEPHONE" jdbcType="String" nullValue=""/>
34. <result property="mobilePhone" column="MOBILEPHONE" jdbcType="String" nullValue=""/>
35. <result property="fax" column="FAX" jdbcType="String" nullValue=""/>
36. <result property="address" column="ADDRESS" jdbcType="String" nullValue=""/>
37. <result property="postCode" column="POST_CODE" jdbcType="String" nullValue=""/>
38. <result property="degree" column="DEGREE" jdbcType="String" nullValue=""/>
39. <result property="vocation" column="VOCATION" jdbcType="String" nullValue=""/>
40. <result property="source" column="SOURCE" jdbcType="String" nullValue=""/>
41. <result property="typeName" column="KEY_NAME" jdbcType="String" nullValue=""/>
42. </resultMap>
43. <parameterMap id="procQueryMap" class="java.util.HashMap" >
44. <parameter property="P_USER_NAME" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
45. <parameter property="P_REAL_NAME" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
46. <parameter property="P_USER_TYPE" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
47. <parameter property="P_BRANCH_ID" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
48. <parameter property="P_BEGIN_DATE" jdbcType="DATE" javaType="java.util.Date" mode="IN"/>
49. <parameter property="P_END_DATE" jdbcType="DATE" javaType="java.util.Date" mode="IN"/>
50. <parameter property="P_BEGIN" jdbcType="INTEGER" javaType="java.lang.Integer" mode="IN"/>
51. <parameter property="P_END" jdbcType="INTEGER" javaType="java.lang.Integer" mode="IN"/>
52. <parameter property="P_RESULT" jdbcType="INTEGER" javaType="java.lang.Integer" mode="OUT"/>
53. <parameter property="P_CURSOR" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT"/>
54. </parameterMap>
55. <procedure id="queryUserBasicInfoProc" parameterMap="procQueryMap" resultMap="detailMap">
56. {call QUERY_USER_BASIC_INFO (?,?,?,?,?,?,?,?,?,?)}
57. </procedure>
58. </sqlMap>
1. /**
2. * <p>this method is used by people get user list.
3. * @param map
4. * @return List
5. * @throws DataAccessException
6. */
7. @SuppressWarnings("unchecked")
8. public List<UserBasicInfo> getList(Map<String, Object> map)
9. throws DataAccessException {
10. return this.getSqlMapClientTemplate().queryForList(statementName + ".queryUserBasicInfoProc", map);
11. }
出自:http://blog.csdn.net/xiaojunhu/archive/2009/07/24/4375976.aspx
# ( "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
# "USER_NAME" VARCHAR2(50 BYTE) NOT NULL ENABLE,
# "REAL_NAME" VARCHAR2(50 BYTE),
# "PASSWORD" VARCHAR2(32 BYTE) NOT NULL ENABLE,
# "EMAIL" VARCHAR2(50 BYTE) NOT NULL ENABLE,
# "USER_TYPE" VARCHAR2(50 BYTE),
# "USER_STATE" VARCHAR2(50 BYTE),
# "LOGIN_COUNT" NUMBER(8,0) DEFAULT 0,
# "QUESTION" VARCHAR2(200 BYTE),
# "ANSWER" VARCHAR2(200 BYTE),
# "ACCOUNT" VARCHAR2(50 BYTE) DEFAULT -1,
# "BRANCH_ID" VARCHAR2(50 BYTE) DEFAULT -1,
# "CREATE_DATE" DATE DEFAULT sysdate,
# "MODIFY_DATE" DATE DEFAULT sysdate,
# "LAST_VISIT" DATE DEFAULT sysdate,
# "USER_LEVEL" VARCHAR2(50 BYTE),
# "EXPERIENCE_TIME" NUMBER(4,0) DEFAULT 0,
# "CUSTID" NUMBER(20,0),
# CONSTRAINT "PK_USER_BASIC_INFO" PRIMARY KEY ("USER_ID")
# )
1. CREATE TABLE "USER_EXTEND_INFO"
2. ( "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
3. "SEX" VARCHAR2(50 BYTE),
4. "BIRTHDAY" DATE,
5. "RACE" VARCHAR2(50 BYTE),
6. "PROVINCE" VARCHAR2(50 BYTE),
7. "CITY" VARCHAR2(50 BYTE),
8. "CARD_TYPE" VARCHAR2(50 BYTE),
9. "CARD_ID" VARCHAR2(50 BYTE),
10. "TELEPHONE" VARCHAR2(50 BYTE),
11. "MOBILEPHONE" VARCHAR2(50 BYTE),
12. "FAX" VARCHAR2(50 BYTE),
13. "ADDRESS" VARCHAR2(100 BYTE),
14. "POST_CODE" VARCHAR2(50 BYTE),
15. "DEGREE" VARCHAR2(50 BYTE),
16. "VOCATION" VARCHAR2(50 BYTE),
17. "SOURCE" VARCHAR2(100 BYTE),
18. CONSTRAINT "PK_USER_EXTEND_INFO" PRIMARY KEY ("USER_ID")
19. )
1. create or replace PACKAGE Types
2. AS
3. TYPE ref_cursor IS REF CURSOR;
4. END;
1. create or replace PROCEDURE QUERY_USER_BASIC_INFO
2. ( P_USER_NAME IN USER_BASIC_INFO.USER_NAME % TYPE
3. , P_REAL_NAME IN USER_BASIC_INFO.REAL_NAME % TYPE
4. , P_USER_TYPE IN USER_BASIC_INFO.USER_TYPE % TYPE
5. , P_BRANCH_ID IN USER_BASIC_INFO.BRANCH_ID % TYPE
6. , P_BEGIN_DATE IN DATE
7. , P_END_DATE IN DATE
8. , P_BEGIN IN NUMBER
9. , P_END IN NUMBER
10. , P_RESULT OUT NUMBER
11. , P_CURSOR OUT TYPES.ref_cursor
12. ) AS
13. v_sql varchar2(1000);
14. v_sqlCount varchar2(1000);
15. BEGIN
16. v_sql:='SELECT * FROM (
17. SELECT
18. row_.*,
19. ROWNUM rownum_
20. FROM (
21. SELECT e.*,f.SEX,
22. f.BIRTHDAY,
23. f.RACE,
24. f.PROVINCE,
25. f.CITY,
26. f.CARD_TYPE,
27. f.CARD_ID,
28. f.TELEPHONE,
29. f.MOBILEPHONE,
30. f.FAX,
31. f.ADDRESS,
32. f.POST_CODE,
33. f.DEGREE,
34. f.VOCATION,
35. f.SOURCE,g.key_name FROM USER_BASIC_INFO e left join user_extend_info f on e.user_id=f.user_id
36. left join dictionary g on e.user_type=g.key_code and g.parent_id=11
37. where 1=1';
38. IF P_USER_NAME IS NOT NULL THEN
39. v_sql := v_sql || 'and e.USER_NAME LIKE ' || '''' || P_USER_NAME || '''';
40. ELSE IF P_REAL_NAME IS NOT NULL THEN
41. v_sql := v_sql || 'and e.REAL_NAME LIKE ' || '''' || P_REAL_NAME || '''';
42. ELSE IF P_USER_TYPE IS NOT NULL THEN
43. v_sql := v_sql || 'and e.USER_TYPE = ' || '''' || P_USER_TYPE || '''';
44. ELSE IF P_BRANCH_ID IS NOT NULL THEN
45. v_sql := v_sql || 'and e.BRANCH_ID = ' || '''' || P_BRANCH_ID || '''';
46. ELSE IF P_BEGIN_DATE IS NOT NULL THEN
47. v_sql := v_sql || 'and e.CREATE_DATE between ' || P_BEGIN_DATE || 'and ' || P_END_DATE;
48. END IF;
49. END IF;
50. END IF;
51. END IF;
52. END IF;
53. v_sql := v_sql || ') row_ WHERE ROWNUM <= ' || P_END || ') WHERE rownum_ >' || P_BEGIN;
54. --DBMS_OUTPUT.PUT_LINE(v_sql);
55. open P_CURSOR for v_sql;
56.
57. v_sqlCount := 'SELECT count(1) FROM USER_BASIC_INFO e left join user_extend_info f on e.user_id=f.user_id';
58. IF P_USER_NAME IS NOT NULL THEN
59. v_sql := v_sql || 'and e.USER_NAME LIKE ' || '''' || P_USER_NAME || '''';
60. ELSE IF P_REAL_NAME IS NOT NULL THEN
61. v_sql := v_sql || 'and e.REAL_NAME LIKE ' || '''' || P_REAL_NAME || '''';
62. ELSE IF P_USER_TYPE IS NOT NULL THEN
63. v_sql := v_sql || 'and e.USER_TYPE = ' || '''' || P_USER_TYPE || '''';
64. ELSE IF P_BRANCH_ID IS NOT NULL THEN
65. v_sql := v_sql || 'and e.BRANCH_ID = ' || '''' || P_BRANCH_ID || '''';
66. ELSE IF P_BEGIN_DATE IS NOT NULL THEN
67. v_sql := v_sql || 'and e.CREATE_DATE between ' || P_BEGIN_DATE || 'and ' || P_END_DATE;
68. END IF;
69. END IF;
70. END IF;
71. END IF;
72. END IF;
73. EXECUTE IMMEDIATE v_sqlCount into P_RESULT;
74. EXCEPTION
75. WHEN NO_DATA_FOUND THEN
76. P_RESULT := 9006;
77. WHEN OTHERS THEN
78. P_RESULT := 9005;
79. END QUERY_USER_BASIC_INFO;
1. <?xml version="1.0" encoding="UTF-8"?>
2. <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
3.
4. <!-- iBatis SQL Map 文件 -->
5. <sqlMap namespace="com.cssweb.idm.user.pojo.UserBasicInfo">
6. <typeAlias alias="userBasicInfo" type="com.cssweb.idm.user.pojo.UserBasicInfo"/>
7. <resultMap id="detailMap" class="userBasicInfo">
8. <result property="userId" column="USER_ID" jdbcType="Long"/>
9. <result property="userName" column="USER_NAME" jdbcType="String" nullValue=""/>
10. <result property="realName" column="REAL_NAME" jdbcType="String" nullValue=""/>
11. <result property="password" column="PASSWORD" jdbcType="String" nullValue=""/>
12. <result property="email" column="EMAIL" jdbcType="String" nullValue=""/>
13. <result property="userType" column="USER_TYPE" jdbcType="String" nullValue=""/>
14. <result property="userState" column="USER_STATE" jdbcType="String" nullValue=""/>
15. <result property="loginCount" column="LOGIN_COUNT" jdbcType="java.lang.Integer" nullValue="0"/>
16. <result property="question" column="QUESTION" jdbcType="String" nullValue=""/>
17. <result property="answer" column="ANSWER" jdbcType="String" nullValue=""/>
18. <result property="account" column="ACCOUNT" jdbcType="java.lang.Integer" nullValue="0"/>
19. <result property="branchId" column="BRANCH_ID" jdbcType="String" nullValue=""/>
20. <result property="createDate" column="CREATE_DATE" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
21. <result property="modifyDate" column="MODIFY_DATE" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
22. <result property="lastVisit" column="LAST_VISIT" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
23. <result property="userLevel" column="USER_LEVEL" jdbcType="String" nullValue=""/>
24. <result property="experienceTime" column="EXPERIENCE_TIME" jdbcType="java.lang.Integer" nullValue="0"/>
25. <result property="custId" column="CUSTID" jdbcType="Long" nullValue="0"/>
26. <result property="sex" column="SEX" jdbcType="String" nullValue=""/>
27. <result property="birthday" column="BIRTHDAY" jdbcType="java.util.Date" nullValue="1900/01/01 00:00:00"/>
28. <result property="race" column="RACE" jdbcType="String" nullValue=""/>
29. <result property="province" column="PROVINCE" jdbcType="String" nullValue=""/>
30. <result property="city" column="CITY" jdbcType="String" nullValue=""/>
31. <result property="cardType" column="CARD_TYPE" jdbcType="String" nullValue=""/>
32. <result property="cardId" column="CARD_ID" jdbcType="String" nullValue=""/>
33. <result property="telephone" column="TELEPHONE" jdbcType="String" nullValue=""/>
34. <result property="mobilePhone" column="MOBILEPHONE" jdbcType="String" nullValue=""/>
35. <result property="fax" column="FAX" jdbcType="String" nullValue=""/>
36. <result property="address" column="ADDRESS" jdbcType="String" nullValue=""/>
37. <result property="postCode" column="POST_CODE" jdbcType="String" nullValue=""/>
38. <result property="degree" column="DEGREE" jdbcType="String" nullValue=""/>
39. <result property="vocation" column="VOCATION" jdbcType="String" nullValue=""/>
40. <result property="source" column="SOURCE" jdbcType="String" nullValue=""/>
41. <result property="typeName" column="KEY_NAME" jdbcType="String" nullValue=""/>
42. </resultMap>
43. <parameterMap id="procQueryMap" class="java.util.HashMap" >
44. <parameter property="P_USER_NAME" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
45. <parameter property="P_REAL_NAME" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
46. <parameter property="P_USER_TYPE" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
47. <parameter property="P_BRANCH_ID" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
48. <parameter property="P_BEGIN_DATE" jdbcType="DATE" javaType="java.util.Date" mode="IN"/>
49. <parameter property="P_END_DATE" jdbcType="DATE" javaType="java.util.Date" mode="IN"/>
50. <parameter property="P_BEGIN" jdbcType="INTEGER" javaType="java.lang.Integer" mode="IN"/>
51. <parameter property="P_END" jdbcType="INTEGER" javaType="java.lang.Integer" mode="IN"/>
52. <parameter property="P_RESULT" jdbcType="INTEGER" javaType="java.lang.Integer" mode="OUT"/>
53. <parameter property="P_CURSOR" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT"/>
54. </parameterMap>
55. <procedure id="queryUserBasicInfoProc" parameterMap="procQueryMap" resultMap="detailMap">
56. {call QUERY_USER_BASIC_INFO (?,?,?,?,?,?,?,?,?,?)}
57. </procedure>
58. </sqlMap>
1. /**
2. * <p>this method is used by people get user list.
3. * @param map
4. * @return List
5. * @throws DataAccessException
6. */
7. @SuppressWarnings("unchecked")
8. public List<UserBasicInfo> getList(Map<String, Object> map)
9. throws DataAccessException {
10. return this.getSqlMapClientTemplate().queryForList(statementName + ".queryUserBasicInfoProc", map);
11. }
出自:http://blog.csdn.net/xiaojunhu/archive/2009/07/24/4375976.aspx
发表评论
-
gson java.lang.UnsupportedOperationException
2013-11-06 20:03 0java.lang.UnsupportedOperation ... -
JDBC分层事务管理机制
2009-11-14 21:42 1571虽然ORM框架在J2EE应用中 ... -
JDBC事务编程模型备忘
2009-11-14 21:35 1310import java.sql.*; /** * JDB ... -
JDBC的事务
2009-11-14 21:31 1145JDBC的事务 收藏 事务的概念: 数据库中一些操作的集 ... -
proxool 种AdminServlet类 不能显示中文
2009-11-13 19:05 4243Tomcat6+proxool中文不能正常显示问题 汉字的 ... -
proxool
2009-11-13 18:04 1860Proxool连接池的使用方法、心得 官 ...
相关推荐
ibatis调用oracle存储过程分页
在IT领域,特别是数据库操作与Java开发中,利用ibatis框架调用...通过上述步骤,我们可以成功地使用ibatis调用Oracle存储过程,并处理返回的多个结果集。这不仅简化了数据库操作,还提高了代码的可读性和可维护性。
### Ibatis调用Oracle存储过程返回自定义类型 在企业级应用开发中,尤其是在金融、保险等业务场景中,往往需要处理复杂的数据结构与逻辑。本文将深入探讨如何使用Ibatis框架来调用Oracle数据库中的存储过程,并实现...
ibatIS调用存储过程是数据库操作中常见的一种技术,特别是在复杂的业务逻辑处理或数据批量操作时,存储过程能够提供更高的效率和更好的性能。本文将深入探讨如何在ibatIS框架中调用存储过程,以及涉及到的相关知识点...
其中,`id`是方法名,`parameterType`表示没有输入参数,`resultType`则是返回结果的类型,这里我们假设存储过程返回的是一个Map。 2. **带参数的存储过程** 对于带参数的存储过程,我们需要在`<select>`标签内...
### iBatis调用存储过程返回游标 #### 存储过程简介 存储过程是预先编译并存储在数据库中的SQL代码块,它可以接受输入参数,执行一系列操作,并返回一个或多个输出结果。当需要频繁执行复杂的数据库操作时,使用...
iBatis调用存储过程
在Java开发中,使用iBATIS(现在称为MyBatis)作为持久层框架时,调用数据库的存储过程是一种常见的需求。本文将详细介绍如何使用iBATIS调用存储过程,并提供一个简单的示例来说明其过程。 首先,我们需要在数据库...
根据提供的文件信息,标题为“ibatis调用存储过程”,主要关注的是如何使用ibatis框架来调用数据库中的存储过程。下面将详细解释ibatis框架的基本概念、存储过程的概念以及如何在ibatis中配置和执行存储过程。 ### ...
2. **Oracle存储过程**:存储过程与函数类似,但不一定要返回值。它可以接收输入参数(IN参数)、输出参数(OUT参数)或者两者都有(IN/OUT参数),并可以执行一系列操作,如更新数据、查询等。例如,`PROCEDURE ...
### Ibatis调用存储过程详解 #### 一、引言 在实际的软件开发过程中,存储过程因其执行效率高及数据库级别的安全性等优点被广泛应用于各种业务场景之中。而对于使用Ibatis作为持久层框架的应用来说,如何有效地...
在iBatis中,当存储过程返回一个游标时,你可以将其映射为一个Java List。为此,你需要在Java方法中声明一个List类型的参数,而在SQL映射文件中,使用`<resultMap>`定义一个结果集映射,然后在`<selectResult>`标签...
3. **存储过程调用**:Ibatis可以通过`<select>`、`<procedure>`元素调用Oracle的存储过程,增强业务逻辑的封装性。 4. **连接池管理**:Ibatis可以与各种连接池(如C3P0、Druid、HikariCP等)集成,提高数据库连接...
"IBatis查删改查与调用存储过程 mysql数据库" 这个标题揭示了本文将深入探讨如何使用IBatis框架在MySQL数据库中执行基本的CRUD(创建、读取、更新、删除)操作,以及如何调用存储过程。IBatis是一个轻量级的Java持久...
ibatis 读取oracle clob类型
在调用存储过程时,Ibatis允许开发者编写SQL语句或存储过程,然后在XML配置文件中定义这些操作,使得调用过程直观且易于维护。 Blazeds是一个Flash Remoting解决方案,主要用于Flex和Java之间的数据通信。通过...
5. **调用Ibatis接口**:在Java代码中,通过SqlSession对象调用SQL映射文件中的方法执行数据库操作。例如: ```java SqlSession session = sqlSessionFactory.openSession(); User user = session.selectOne(...
3. **SQL语句的编写**:包含增删改查(CRUD)的各种操作,可能涉及到存储过程、触发器等高级特性。 4. **数据持久化操作**:通过Ibatis实现Java对象与数据库记录之间的映射,理解动态SQL的概念。 5. **事务管理**...