Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31488DBFC for ; Thu, 27 Dec 2012 15:00:59 +0000 (UTC) Received: (qmail 32071 invoked by uid 500); 27 Dec 2012 15:00:59 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 31936 invoked by uid 500); 27 Dec 2012 15:00:58 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Delivered-To: moderator for derby-dev@db.apache.org Received: (qmail 21010 invoked by uid 99); 27 Dec 2012 12:37:39 -0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.250.139 is neither permitted nor denied by domain of jadhao.aniruddha@gmail.com) Date: Thu, 27 Dec 2012 04:37:11 -0800 (PST) From: aniderbian To: derby-dev@db.apache.org Message-ID: In-Reply-To: <50DB9A29.1070301@oracle.com> References: <1355822174819-125897.post@n7.nabble.com> <50D7CA06.2090204@oracle.com> <50D868C8.5080701@oracle.com> <50DB9A29.1070301@oracle.com> Subject: Re: Exit value of ij tool on command prompr MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1841_2711317.1356611831382" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1841_2711317.1356611831382 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit i have got success in parsing the script using StatementReader. Now I can get each statement separately of the script file but I doubt if it serves my purpose. My script file is ---- connect 'jdbc:derby:../../target/sample;create=false'; CREATE TABLE app_version ( app_version VARCHAR(45) NOT NULL , script_no VARCHAR(45) DEFAULT NULL , script_status VARCHAR(45) DEFAULT NULL ); insert into app_version values('2.0','1','SUCCESS'); ----- My purpose is to check the status of the above script whether it runs or fails . How will I achieve this using the StatementReader class. How will I execute an individual statement using IJ in java? If you would be having an handy sample code , would really help . Thanks --Ani Pl Save the environment. Please don't print this email unless you really need to. On Thu, Dec 27, 2012 at 6:16 AM, Dag Wanvik [via Apache Database] < ml-node+s10148n126081h43@n7.nabble.com> wrote: > > On 26.12.2012 18:54, aniderbian wrote: > > thanks for replying, I dont see StatementFinder.java class in > attachment. where will I get this java file? > > > It's part of "tools.jar": org.apache.derby.impl.tools.ij.StatementFinder > > Thanks, > Dag > > > --Ani > Pl Save the environment. Please don't print this email unless you really > need to. > > > > > > On Mon, Dec 24, 2012 at 8:08 PM, Rick Hillegas-3 [via Apache Database] <[hidden > email] > wrote: > >> On 12/23/12 7:20 PM, Dag Wanvik wrote: >> >> > On 18.12.2012 19:16, aniderbian wrote: >> >> Hello, >> >> I am running a windows batch script in which I have a need to fire >> below >> >> command >> >> *java -jar ..\db-derby-10.9.1.0-lib\lib\derbyrun.jar ij sql_file.txt >> *. >> >> >> >> Now after firing above command I want to check return exit status to >> >> capture the success/failure of it . >> >> >> >> Or if there is any alternative way to achieve this please suggest. >> >> >> >> Thanks >> > As far as I know, there is no such feature, the exit code is that of >> the >> > Java VM exiting, so it would normally be 0. >> > You probably want to know the success or failure of individual SQL >> > statements in the script. Presently there is no feature to easily >> > capturing those and relaying the results back to the OS invocation >> level >> > of ij. IJ scripting is very basic. >> > If you need such status codes, you'd probably be better off writing a >> > small JDBC application. >> > >> > Thanks, >> > Dag >> You may be able to use the StatementReader program attached to >> https://issues.apache.org/jira/browse/DERBY-5690. This program parses an >> ij script into individual statements so that you can run them >> individually and track their status. >> >> Hope this helps, >> -Rick >> >> -- >> >> View this message in context: >> http://apache-database.10148.n7.nabble.com/Exit-value-of-ij-tool-on-command-prompr-tp125897.html >> >> Sent from the Apache Derby Developers mailing list archive at >> Nabble.com. >> > >> >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the >> discussion below: >> >> http://apache-database.10148.n7.nabble.com/Exit-value-of-ij-tool-on-command-prompr-tp125897p126072.html >> To unsubscribe from Exit value of ij tool on command prompr, click here >> . >> NAML >> > > > ------------------------------ > View this message in context: Re: Exit value of ij tool on command prompr > > Sent from the Apache Derby Developers mailing list archiveat Nabble.com. > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-database.10148.n7.nabble.com/Exit-value-of-ij-tool-on-command-prompr-tp125897p126081.html > To unsubscribe from Exit value of ij tool on command prompr, click here > . > NAML > -- View this message in context: http://apache-database.10148.n7.nabble.com/Exit-value-of-ij-tool-on-command-prompr-tp125897p126093.html Sent from the Apache Derby Developers mailing list archive at Nabble.com. ------=_Part_1841_2711317.1356611831382 Content-Type: text/html; charset=UTF8 Content-Transfer-Encoding: quoted-printable i have got success in parsing the script using StatementReader. Now I can g= et each statement=C2=A0separately of the script file but I doubt if it serv= es my purpose.

My script file is=C2=A0
----
connect 'jdbc:derby:../../target/sample;create=3Dfalse';
=

CREATE =C2=A0TABLE app_version (
=C2=A0 app_v= ersion VARCHAR(45) NOT NULL ,
=C2=A0 script_no VARCHAR(45) DEFAUL= T NULL ,
=C2=A0 script_status VARCHAR(45) DEFAULT NULL=C2=A0
=C2=A0 )= ;
=C2=A0=C2=A0
insert into app_version values('2.0&= #39;,'1','SUCCESS');
-----
My purpose i= s to check the status of the above script whether it runs or fails . How wi= ll I achieve this using the StatementReader class. How will I execute an=C2= =A0individual=C2=A0statement using IJ in java? If you would be having an ha= ndy sample code , would really help .

Thanks=C2=A0
--Ani
Pl Save the= environment. Please don't print this email unless you really need to.<= br>

=C2=A0


On Thu, Dec 27, 2012 at 6:16 AM, Dag Wan= vik [via Apache Database] <[hidden email]> wrote:
=09 =20 =20 =20 =20
On 26.12.2012 18:54, aniderbian wrote:
thanks for r= eplying, =C2=A0I dont see =C2=A0Statem= entFinder.java class in attachment. where will I get this java file?

It's part of "tools.jar":=C2=A0 org.apache.derby.impl.tools.ij.StatementFinder

Thanks,
Dag


--Ani
Pl Save the environment. Please don't print this email unless you really need to.


=C2=A0


On Mon, Dec 2= 4, 2012 at 8:08 PM, Rick Hillegas-3 [via Apache Database] <[hidden email]> wrote:
On 12/23/12 7:20 PM, Dag Wanvik wrote:

> On 18.12.2012 19:16, aniderbian wrote:
>> Hello,
>> I am running a windows batch =C2=A0script in which= I have a need to fire =C2=A0below
>> command
>> *java -jar ..\db-derby-10.9.1.0-lib\lib\derbyrun.jar ij sql_file.txt *.
>>
>> Now after firing above command I want to check return exit status =C2=A0to
>> capture =C2=A0the success/failure of it .
>>
>> Or if there is any alternative =C2=A0way to achiev= e this please suggest.
>>
>> Thanks
> As far as I know, there is no such feature, the exit code is that of the
> Java VM exiting, so it would normally be 0.
> You probably want to know the success or failure of individual SQL
> statements in the script. Presently there is no feature to easily
> capturing those and relaying the results back to the OS invocation level
> of ij. IJ scripting is very basic.
> If you need such status codes, you'd probably be better off writing a
> small JDBC application.
>
> Thanks,
> Dag
You may be able to use the StatementReader program attached to
https://issues.apache.org= /jira/browse/DERBY-5690. This program parses an
ij script into individual statements so that you can run them
individually and track their status.

Hope this helps,
-Rick
>> --
>> View this message in context: http://apach= e-database.10148.n7.nabble.com/Exit-value-of-ij-tool-on-command-prompr-tp12= 5897.html
>> Sent from the Apache Derby Developers mailing list archive at Nabble.com.
>




If you reply to this email, your message will be added to the discussion below:
http://apache-database.10148.n7.nabble.com/= Exit-value-of-ij-tool-on-command-prompr-tp125897p126072.html
To unsubscribe from Exit value of ij tool on command prompr, click here.
NAML



View this message in context: Re: Exit value of ij tool on command prompr

Sent from the Apache Derby Developers mailing list archive at Nabble.com.

=20 =09 =09 =09 =09
=09
=09
=09
=09=09
If you reply to this email, your mess= age will be added to the discussion below:
=09=09
http://apache-database.10148.n7.nabble.com/= Exit-value-of-ij-tool-on-command-prompr-tp125897p126081.html =09
=09
=09=09 =09=09To unsubscribe from Exit value of ij tool on command prompr, click here.<= br> =09=09NAML =09

=09 =09 =09

View this message in context: Re: = Exit value of ij tool on command prompr
Sent from the Apache Derby Developers mailing list archive = at Nabble.com.
------=_Part_1841_2711317.1356611831382--