发布网友 发布时间:2022-04-07 16:07
共4个回答
懂视网 时间:2022-04-07 20:29
java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import oracle.ConnectionManager; import oracle.exception.GetConnectionException; public class JDBC_EXEC { public static void main(String[] args) throws SQLException, GetConnectionException { String ip="ip"; String user="user"; String password="pwd"; String instanceName="orcl"; ConnectionManager cm=new ConnectionManager(ip,instanceName,user,password); Connection conn=cm.getOracleConnection(); String sql="begin"+ " dbms_stats.gather_table_stats(ownname => ‘user‘,"+ " tabname => ‘tableName,"+ " estimate_percent => null,"+ " method_opt => ‘for all indexed columns‘,"+ " cascade => true);"+ " end;"; Statement cs=conn.createStatement(); System.out.println(cs.executeUpdate(sql)); cm.close(cs); cm.close(conn); } }
输出:
1
http://stackoverflow.com/questions/6214172/pl-sql-call-from-jdbc-resulting-in-sqlsyntaxerrorexception-ora-00900/6214370#6214370
执行Sql块
标签:
热心网友 时间:2022-04-07 17:37
打开一个command windows,中文大概叫命令窗口热心网友 时间:2022-04-07 18:55
存储过程热心网友 时间:2022-04-07 20:29
使用function追问麻烦详细点,谢谢!