i have registred the output parameter
cstmt.registerOutParameter(1,Types.INTEGER);
cstmt.execute();
int counti=cstmt.getInt(1);
System.out.println("counti"+counti);
i am getting o if i have done as above
-----Original Message-----
From: Gochwal Meenu [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 05, 2001 11:07 AM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat: jsp : JDBC & ORACLE
There is some error in ur code
Use it this way
l_Stmt.registerOutParameter(1,Types.INTEGER);
l_Stmt.execute();
int l_Return = l_Stmt.getInt(1);
now check what l_Return returns
What i mean to say was that instead of using this stored procedure
use addBatch(String sql).In this pass the query which is to be executed.
Then use updateBatch() which returns u the int[] array i.e the no of rows
that where updated/inserted
> -----Original Message-----
> From: SriHari [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, November 05, 2001 10:45 AM
> To: [EMAIL PROTECTED]
> Subject: Tomcat: jsp : JDBC & ORACLE
>
> Hai
>
> by bean which executes the oracle stored procedure looks some thing like
> this
>
> i am calling procedure from jsp
> ===
> int param1=3;
> String param2="testdhjkhghghjhgh";
> String squery2="ProxyzInsert "+param1+",'"+param2+"'";
> out.println(db.execDMLProc(squery2)); // i am getting -1 here i expect
> 1
> or some interger
> ===
> public int execDMLProc(String s) throws---
> {
> ----
> if (procedure with out params)
> {
> cstmt = dbcon.prepareCall("{ call "+s+"}"); // where s is the string
> }
> ----
> if (procedure with params)
> {
>
> SEPERATE PARAMETERS()
> cstmt.setInt(1,Integer.parseInt(param1));
> cstmt.setString(2,param2; // setting parameters
> ...
> ...
> // Now i tried
> cstmt.getUpdatCount(); // returning -1
> or
> cstmt.addBatch(); // getting -1 result
> cstmt.executeBatch();
> }
> ----
> }
>
>
>
>
>
> can any one explain me how to get no of records updated by executing
> Oracle
> stored Procedure
>
>
>
> Regards
> Srihari
> -----Original Message-----
> From: Gochwal Meenu [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 05, 2001 10:05 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Tomcat: jsp : JDBC & ORACLE
>
>
> Hi
>
> use addBatch(String sql)
> then executeBatch() which Submits a batch of commands to the database for
> execution and if all commands execute successfully, returns an array of
> update counts.This can be used incase u want to know the no of rows
> updated.
>
>
> > -----Original Message-----
> > From: SriHari [SMTP:[EMAIL PROTECTED]]
> > Sent: Saturday, November 03, 2001 3:54 PM
> > To: [EMAIL PROTECTED]
> > Subject: Tomcat: jsp : JDBC & ORACLE
> >
> > Hai all
> >
> > By using JDBC CallableStatement i am executing Oracle Stored Functions
> > and
> > Procedures
> > In Procedures like Insert Update and Delete I have to know the no of
> > records updated
> > When i am calling a Oracle Stored Procedure processing(DML operations
> > like
> > insert,update,delete)
> > commands
> > How can i get the Inserted/Deleted/Updated no of Record as
> > callablestatement.getUpdateCount method dosent return no of rows
> effected
> >
> >
> >
> >
> >
> > Thanks
> > Srihari
> > -----Original Message-----
> > From: SriHari
> > Sent: Wednesday, October 31, 2001 6:47 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Tomcat: jsp : JDBC & ORACLE
> >
> >
> > Thanks for the code
> > i am using classes111.zip
> > i was not getting
> > OracleTypes from oracle.jdbc.OracleTypes
> > can u point me to the resource
> >
> >
> > Thanks Again
> >
> > Srihari
> >
> >
> > -----Original Message-----
> > From: Jan Aren� [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, October 31, 2001 6:09 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Tomcat: jsp : JDBC & ORACLE
> >
> >
> > Here is how I do
> >
> > rs = ResultSet
> > cstmt = CallableStatement
> >
> >
> > cstmt = conn.prepareCall("begin PACKAGE.procedure(?,?,?); end;");
> >
> > cstmt.registerOutParameter(1, OracleTypes.CURSOR);
> > cstmt.setString(2, para1);
> > cstmt.setString(2, para2);
> >
> > cstmt.execute();
> >
> > rs = ((OracleCallableStatement)cstmt).getCursor(1);
> >
> > while(rs.next())
> > {
> > // Like a normal rs
> > }
> >
> > As you can see I have the Cursor as a parameter, but if you have a
> > "storedFunction" I guess you could return the Cursor also...
> >
> > Hoped it helped
> >
> > // Jan Aren�
> >
> > -----Ursprungligt meddelande-----
> > Fr�n: A mailing list about Java Server Pages specification and reference
> > [mailto:[EMAIL PROTECTED]]F�r SriHari
> > Skickat: den 31 oktober 2001 12:06
> > Till: [EMAIL PROTECTED]
> > �mne: Tomcat: jsp : JDBC & ORACLE
> >
> >
> > I am using Stored(Functions) in oracle which return cursors
> type(multiple
> > rows)
> >
> > How can i allot them to resultset in jsp /Java code
> > How to call the function in java code so that i can use the rows just
> like
> > i
> > have used the result using SQL server/Access as my database
> >
> > ie i have used Resultset in SQL database (Result set in java code)
> > how can i use Cursors in Oracle to use them in jsp/java (???????);
> >
> >
> > Regards
> > SriHari
> >
> >
> ==========================================================================
> > =
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://archives.java.sun.com/jsp-interest.html
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.jsp
> > http://www.jguru.com/faq/index.jsp
> > http://www.jspinsider.com
> >
> >
> ==========================================================================
> > =
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://archives.java.sun.com/jsp-interest.html
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.jsp
> > http://www.jguru.com/faq/index.jsp
> > http://www.jspinsider.com
> >
> >
> ==========================================================================
> > To
> > unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://archives.java.sun.com/jsp-interest.html
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.jsp
> > http://www.jguru.com/faq/index.jsp
> > http://www.jspinsider.com
> >
> >
> ==========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://archives.java.sun.com/jsp-interest.html
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.jsp
> > http://www.jguru.com/faq/index.jsp
> > http://www.jspinsider.com
>
> ==========================================================================
> To
> unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
>
> ==========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
==========================================================================To
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com