java中使用ibatis来调用存储过程(下)
3.3 游标循环最佳策略
我们在进行PL/SQL编程时,经常需要循环读取结果集的数据。进行逐行处理,这个过程就需要对游标进行循环。对游标进行循环的方法有多种,我们在此一一分析。
create or replace procedure proccycle(p varchar2)
as
cursor c_postype is select pos_type, description from pos_type_tbl where rownum < 6;
v_postype varchar2(20);
v_description varchar2(50);
begin
open c_postype;
if c_postype%found then
dbms_output.put_line('found true');
elsif c_postype%found = false then
dbms_output.put_line('found false');
else
dbms_output.put_line('found null');
end if;
loop
fetch c_postype into v_postype,v_description ;
exit when c_postype%notfound;
dbms_output.put_line('postype:'||v_postype||',description:'||v_description);
end loop;
close c_postype;
dbms_output.put_line('---loop end---');
open c_postype;
fetch c_postype into v_postype,v_description;
while c_postype%found loop
dbms_output.put_line('postype:'||v_postype||',description:'||v_description);
fetch c_postype into v_postype,v_description ;
end loop;
close c_postype;
dbms_output.put_line('---while end---');
for v_pos in c_postype loop
v_po
相关文档:
服务器端:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class ThreadSocketServer extends Thread {
private Socket client;
&n ......
项目中有的文件夹原来是svn版本控制的,现在不想控制了,就像把这个文件夹传给别人或者自己备份,但是看到那么多.svn文件夹实在不舒服,写了下面的简单程序用来删除这些文件,以后需要删除的话,设置好文件夹路径和要删除的文件夹名字跑一下就行了。
import java.io.File;
/*
* To change this template, choose Tools ......
JCheckBox:
复选框;
JComboBox:
下拉列表;
JTextField:
允许编辑单行文本;
JTextArea:
允许编辑的多行文本区域;
JTextPa ......
EJB: Enterprise JavaBeans 企业JavaBean组件
IDL: Interface Definition Language 接口定义语言
J2EE CA:J2EE Connector Architecture J2EE 连接器架构
JAAS : The Java Authenticat ......
1先看一下程序:
package com.redking.jdbc.demo;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBCDemo07 {
......