摘要: 因为用到了spring 的jdbctemplate 的 处理存储过程的原因花了两天的时间 来翻看 回调的例子 文档 网上的例子 终于有所收获最后自己领悟了一点 所谓回调 就是:类Server 实现了 某个接口(该接口中可以定义标准) ,但是在Server中并没有写接口中方法(这个方法就是所谓的回调函数)的具体实现Server类中实现了 自身的一些基础操作(因为这些基础操作可能会重复:如jdbctemplate 的中的 数据库获取连接,关闭资源等),剩下的具体操作(如 封装 preparedStatememt中的封装参数)交给Client类(这个类可以是匿名类)来实现。Client 类中肯定会引 阅读全文
posted @ 2013-08-01 09:52 roscee 阅读(207) 评论(0) 推荐(0) 编辑
摘要: http://sunbin123.iteye.com/blog/1007556使用Spring JdbcTemplate调用存储过程Spring的SimpleJdbcTemplate将存储过程的调用进行了良好的封装,但可惜只能用于jdk1.5的环境,无法再jdk1.4环境下使用,而JdbcTemplate则完全适用于jdk1.4下的环境,下面列出使用JdbcTemplate调用Oracle存储过程的一些方法:一) 无返回值的存储过程调用存储过程:Java代码1:CREATEORREPLACEPROCEDURETESTPRO(PARAM1INVARCHAR2,PARAM2INVARCHAR2)A 阅读全文
posted @ 2013-07-29 10:54 roscee 阅读(318) 评论(0) 推荐(0) 编辑
摘要: --创建包create or replace package pac_stuas type cur_stu is ref cursor; procedure getStu(i in number,cur_stu out cur_stu);end pac_stu;--创建包体create or replace package body pac_stuasprocedure getStu(i in number,cur_stu out cur_stu) as nums number(10); begin select count(*) into nums from stu; if nums... 阅读全文
posted @ 2013-07-28 23:55 roscee 阅读(1570) 评论(0) 推荐(0) 编辑
摘要: create procedure proc_1 asbegin dbms_output.put_line('hello boy ');end proc_1;--set serveroutput on; exec proc_1;create or replace procedure proc_2(v_1 in varchar2,v_2 out varchar2)asbegin v_2:='hello ' || v_1;end proc_2;/*declare v_2 varchar2(100);begin proc_2('boy',v_2); db 阅读全文
posted @ 2013-07-28 18:19 roscee 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 转自:http://blog.sina.com.cn/s/blog_477252210100a7l4.html1、使用org.codehaus.xfire.spring.XFireSpringServlet与ServiceBean1.1 web.xml的配置contextConfigLocationclasspath:applicationContext-webservice.xmlorg.springframework.web.util.Log4jConfigListenerorg.springframework.web.context.ContextLoaderListenerXFireS 阅读全文
posted @ 2013-07-28 00:58 roscee 阅读(1029) 评论(0) 推荐(0) 编辑
摘要: 一 先来看 为整合的Mybatis 使用过程1 接口服务public interface ServerDao{ public User selUser(username);//根据用户名查找用户对象信息 }2 接口服务对应的sql映射文件(serverdao.xml)//xml 前缀。。。 3 mybatis_config 配置//xml 前缀。。。//配置数据源 //配置拥有的 映射文件 4 dao 类 String resource = "resource/mybatis-config.xml"; Reader reader = null; reader = ... 阅读全文
posted @ 2013-07-23 15:30 roscee 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 一 建序列create sequence squence_name increment by 1 --按1增长 start with 1 --从1开始 nomaxvalue --不设最大值 nocycle --不循环 cache 10; --缓冲create sequence seq_f... 阅读全文
posted @ 2013-07-11 16:57 roscee 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 在get提交中,如果提交测参数中含有特殊字符的话在接受参数的时候就没办法读取参数的正确值,那么怎么办呢?下面给大家讲下在jsp中处理方法:假如我在连接<a href="news.jsp?name=A&T Plastic">A&T Plastic</a>,以上的get方式在接受参数的时候就没办法读取name参数的正确值,怎么样才能正确读取,还有其他的特殊字符字符 特殊字符的含义 URL编码下面就是GET提交含有特殊字符的参数处理方法# 用来标志特定的文档位置 %23% 对特殊字符进行编码 %25& 分隔不同的变量值对 %26+ 阅读全文
posted @ 2013-05-20 10:47 roscee 阅读(851) 评论(0) 推荐(0) 编辑
摘要: 文章是网上找的,从来没有弄过,一直是php+mysql 现在搞个php+mssql 也不懂,没有办法,从网上找了些资料,我是看了这些资料,才连上的mssql的第一次感觉真的挺费劲的,这些可能不需要全部看完就ok,我也是这一点那一点,可能是我比较笨吧!呵呵环境:- Apache 2.2.6- PHP 5.2.5- SQL Server 2005- Windows XP SP2步骤:1. 首先按通常做法配置好PHP5连接MS SQL Server2. 下载正确版本的 ntwdblib.dll (2000.80.194.0),注意这个版本号,不是这个版本的dll 不起作用啊,刚开始搞了好久才发现这个 阅读全文
posted @ 2013-05-16 22:56 roscee 阅读(186) 评论(0) 推荐(0) 编辑
摘要: IOC: 控制反转,我觉得很大意义上 是基于类的管理的DI: 依赖注入,可以是在一个类中注入另一个类,也可以是在一个类中注入另一些 基本数据类型数据(整型等),当然也可以是字符串先来看依赖于xml 中配置 bean 的 注入方式:一: set get 注入 (也是最长用的注入方式)public Class ClassA{ private ClassB classB; private String string; ... set 、get 方法}来看 我们在 spring-servlet.xml 中的配置 二: 构造方法注入public Class Class... 阅读全文
posted @ 2013-05-13 15:27 roscee 阅读(514) 评论(0) 推荐(0) 编辑