高手请进:Java中如何执行“show parameters;”这样的语句[在线等] 用正常的jdbc连接并执行sql的方式肯定不行,可是又不能用C调用OCI接口,也不能用调用sqlplus传入参数的方式,请问如何实现。有没有JAVA封装OCI API的代码或例子呢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用 select * from v$parameter 代替吧 不过一般的帐户查不到. system帐户能查到, SYSDBA能查. 关键是还要设置这些参数,使用"alter system set param=XXX"不能绕开啊。 用windows或unix linux的命令行吧~ 我没试过sql*plus的专门语句怎么在JAVA里执行.public static Process executeCommand(String command)throws Exception{ String osName=getOSName().toLowerCase(); Process ps=null; try{ if(osName.indexOf("windows")>-1){ ps=Runtime.getRuntime().exec("cmd /k "+command); } else if(osName.indexOf("linux")>-1){ ps=Runtime.getRuntime().exec(command); } return ps; } catch(Exception ex){ System.out.println("[Error]StringBean.executeCommand() -- Command ["+command+"] not correct."); throw ex; } } 突然想到,上面方法不可行,因为要先登陆....有一点先说明一下,不是所有的parameter都可以动态的修改的.建议: 做个程序,去修改parameter file, 而不是 alter system set .... 这个比较可行 多谢!Runtime.getRuntime().exec的方法是可行的,但是毕竟还需要通过系统来执行,我还是更希望能够直接调用ORACLE的相关接口来实现,这样会比较彻底一点。 如何避免自治事务的死锁? 急!!求解决odbc连接US7ASCII字符集oracle数据库问题方法 关于 字符串相减赋问题 开发中遇见一个问题,关于trigger,内有详细说明,望大家相助! 怎么在PL/SQL里面写select ... in (xxx) 列印有记录的表名,存储过程调不通,麻烦看看. 我想做一个自增索引从99001开始没输入1条纪录自动增加1,请问这个SQL语句怎么写,谢谢!! ORACLE8.17在WIN2003下装不上呀 关于安全的问题。 关于临时表空间 求:数据恢复的语句! 字符串重排列--在线等,解决马上给分!!!
不过一般的帐户查不到. system帐户能查到, SYSDBA能查.
不能绕开啊。
我没试过sql*plus的专门语句怎么在JAVA里执行.public static Process executeCommand(String command)throws Exception{
String osName=getOSName().toLowerCase();
Process ps=null;
try{
if(osName.indexOf("windows")>-1){
ps=Runtime.getRuntime().exec("cmd /k "+command);
}
else if(osName.indexOf("linux")>-1){
ps=Runtime.getRuntime().exec(command);
}
return ps;
}
catch(Exception ex){
System.out.println("[Error]StringBean.executeCommand() -- Command ["+command+"] not correct.");
throw ex;
}
}
Runtime.getRuntime().exec的方法是可行的,但是毕竟还需要通过系统来执行,我还是更希望能够直接调用ORACLE的相关接口来实现,这样会比较彻底一点。