English 中文(简体)
利用 Java管理笔记/笔记
原标题:Trying to run PL/SQL script using Java

我很熟悉Java JDBC,并经常使用它来管理简便。 然而,我想谈一下如下一些。 这比正规的LL/SQL要多,因此我的问题。 我不是从Oracle箱,而是从我自己的电脑操作。 谁能帮助我利用 Java管理这种PL/SQL?

spool C:count.txt;
DEFINE date="TO_DATE ( 08-29-2011 , mm-dd-yyyy )";
SET NEWPAGE 0;
SET SPACE 0;
SET LINESIZE 500;
SET PAGESIZE 0;
SET ECHO OFF;
SET FEEDBACK OFF;
SET VERIFY OFF;
SET HEADING OFF;
SET TRIMSPOOL ON;
alter session set nls_date_format= yyyy-mm-dd hh24:mi ;
select  TABLE1 , count(*) from SCHEMA.TABLE1 where modifyts < &date;
select  TABLE2 , count(*) from SCHEMA.TABLE2 where modifyts < &date;
select  TABLE3 , count(*) from SCHEMA.TABLE3 where modifyts < &date;
spool off;
最佳回答

<代码>SPOOL,DEFINESET均为* 附加指示。 他们在PL/SQL或QQL中无效。 因此,你不能通过除* Plus以外的一种工具来操作这种文字(或一种支持SQL+像开发商或Toad这样的指挥工具)。

当然,你可以向业务系统提出 Java申请,以援引SQ* Plus的可执行性(假定 Java申请在机器上安装),并将该书通过SQ* Plus。 但这一般比你更复杂。 更有意义的是,要么仅仅使用LQ* Plus,要么只发布SlectT,从您的 Java申请中发布声明,并利用Java的档案I/O栏将结果写到档案中。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签