oracle执行cmd的实现方法
int RC = -1;
}
return RC;
/
登陆上去后依旧是依次执行
No errors.
System.out.write(buffer, 0, len);
Rem
end oracmd;
{
Rem Run system commands via Oracle database servers
create or replace
import java.io.*;
unix或linux下用
c:\1.sql
Rem oracmd.sql
@c:\2.sql
@c:\3.sql
网上的另两种方法:
Runtime rt = Runtime.getRuntime();
Package body created.
SQL> @c:\1.sql
}
SQL>
CREATE OR REPLACE PACKAGE BODY oracmd IS
}
as
IWAM_PC-ATQHJ4UG1SDA SUPPORT_388945a0
======================补充======================
function RUN_CMz(p_cmd in varchar2) return number
SQL*Plus: Release 8.1.7.0.0 - Production on Thu Jun 7 14:25:38 2001
! command
SQL> host net user
/
public class util extends Object
import java.lang.*;
测试环境win2003+oracle11g ORA-06512: 在 "SYSTEM.ORACMD", line 2
as
第二种方法
show errors
----------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE oracmd IS
SQL> @c:\orac.sql
PROCEDURE exec (cmdstring IN CHAR);
e.printStackTrace();
Rem Bugs to [email protected]
内容:
'C:\windows\system32\msvcrt.dll';
结果在我本机出现
// Echo back what the program spit out
Rem
(c) Copyright 2000 Oracle Corporation. All rights reserved.
RC = -1;
ORA-28595: Extproc 代理: DLL 路径无效
Connected.
BufferedInputStream bis =new BufferedInputStream(p.getInputStream(), bufSize);
{
begin
User accounts for \\PC-ATQHJ4UG1SDA
show errors
name 'util.RunThis(java.lang.String) return integer';
ORA-06512: 在 line 1
java souRCe named "util"
int bufSize = 4096;
variable x number;
exec dbms_java.set_output(100000);
CREATE OR REPLACE LIBRARY exec_shell AS
SQL> exec oracmd.exec ('dir > c:\oracle.txt');
/
create or replace procedure RC(p_cmd in varChar)
public static int RunThis(String args)
LANGUAGE C;
grant javasyspriv to system;
SQL> connect system/manager@orcl (分别是用户名密码和sid)
/
{
No errors.
{
/
x := RUN_CMz(p_cmd);
finally
exec :x:=run_cmz('ipconfig'); 成功运行了命令
不过有一个简单的执行cmd命令方法:
The command completed successfully.
没有成功。
end oracmd;
IS EXTERNAL
Process p = rt.exec(args);
Rem
1是利用msvcrt.dll
No errors.
第 1 行出现错误:
x number;
Library created.
grant javauserpriv to system;(网上的方法没有这一行,我无法成功,加上去可以)
as
}
PROCEDURE exec(cmdstring IN CHAR)
set serveroutput on;
__vmware_user__ admin Administrator
catch (Exception e)
然后C:\>sqlplus /nolog
Rem
show errors
c:\3.sql
Package created.
c:\2.sql
create or replace and compile
end;
try
ASPNET Guest IUSR_PC-ATQHJ4UG1SDA
}
{
byte buffer[] = new byte[bufSize];
RC = p.waitFor();
language java
写一个c:\orac.sql
/
NAME "system" LIBRARY exec_shell
int len;
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/sql/oracle/2846.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
是因为scan的IP问题补占用
时间:2021-01-20
-
还你一个干净的model 2、功
时间:2021-01-20
-
既然 ROWNUM 列并不是真实存
时间:2021-01-20
-
Real Application Clusters
时间:2021-01-20
-
在tools-preferences-connection(
时间:2021-01-20
-
Windows Sever 2012下Oracle 12c安
时间:2021-01-10
-
Oracle安装监听器错误的解
时间:2021-01-07
-
oracle远程连接服务器数据
时间:2021-01-07
热门文章
-
Oracle存储过程编程详解
时间:2020-12-07
-
Azure Queue Storage 基本用法 Azure Storage 之
时间:2020-12-26
-
win10下oracle 11g安装图文教程
时间:2020-12-25
-
oracle 数据库学习 基本结构介绍
时间:2020-12-13
-
Azure File Storage 基本用法 Azure Storage 之 F
时间:2020-12-26
-
windows使用sqlpus连接oracle 数据库的教程图
时间:2020-12-25
-
Window下Oracle Database 11g 发行版2安装教程
时间:2020-12-29
-
Oracle解锁的方式介绍
时间:2020-12-14
-
Oracle 12c Study之Installer Oracle
时间:2021-01-06
-
linux下oracle设置开机自启动实现方法
时间:2020-12-13
