jdbc中调用oracle存储过程
1、创建表:
create table stud(
sid int,
sname varchar2(50)
)
并插入一条数据
insert into stud values(1,'Tom')
2、创建存储过程
--创建存储过程
create or replace procedure pro_select_name(
v_sid in stud.sid%type,
v_sname out stud.sname%type
)
--声明区
is
--执行体
begin
select sname into v_sname from stud where sid = v_sid;
--异常处理
exception
when others then
dbms_output.put_line(sqlcode||sqlerrm);
end;
3、jdbc中调用
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Types;
public class TestPro {
public void test(){
Connection con = null;
CallableStatement cst = null;
try{
 
相关文档:
ORACLE常用命令
一、ORACLE的启动和关闭
1、在单机环境下
要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下
su - oracle
a、启动ORACLE系统
oracle>svrmgrl
SVRMGR>connect internal
SVRMGR>startup
SVRMGR>quit
b、关闭ORACLE系统
oracle>svrmgrl
SVRMGR>connect internal
SVRMGR& ......
视图
创建新表:create table emp2 as select * from emp;
create view empv20 as select empno,ename,job,hiredate,deptno from emp where deptno=20 with check option;
语法:create or replace view 视图名称 as 子查询(修改之后的子查询)
替换视图(修改)
create or replace view empv20 as select empno,ename, ......
1) 建立序列命令
CREATE SEQUENCE [user.]sequence_name
[increment by n]
[start with n]
[maxvalue n | nomaxvalue]
[minvalue n | nominvalue];
INCREMENT BY: 指定序列号之间的间隔 ......
Oracle9i Database Release 2 Enterprise/Standard/Personal Edition for Windows NT/2000/XP
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk1.zip
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk2.zip
http://download.oracle.com/otn/nt/oracle9i/9201/92010NT_Disk3.zip
Oracle9i ......