Article View: borland.public.jbuilder.database
Article #455Re: ProcedureDataSet and Firebird
From: John Moore
Date: Mon, 12 Sep 2005 18:49
Date: Mon, 12 Sep 2005 18:49
65 lines
3324 bytes
3324 bytes
Ivan,
Actually I rarely use the ProcedureDataSet.. Mostly because it is
overkill for much of my use..
I would check out the help docs section..
"Stored procedures: hints & tips"
There was some examples there as well as a pointer to a sample program..
When I have needed data from a stored proc with parameters AND I want it
to end up in a DX component.. I generally do the following.. (I don't do
any GUI so that has never been an issue for me..)
String _sql = "{call sp_do_financecharge(?,?,?,?)}";
java.sql.CallableStatement _statement = null;
_statement = this.g_con.prepareCall(_sql);
_statement.setDouble(1,Double.parseDouble(arg_sRate));
_statement.setDouble(2,Double.parseDouble(arg_sMinChg));
_statement.setString(3,arg_sChgDate);
_statement.setString(4,arg_sPeriod);
ResultSet _rs = _statement.executeQuery();
if (_rs != null) {
QueryDataSet _qds = null;
try {
_qds = (QueryDataSet)this.g_database.resultSetToDataSet(new
QueryDataSet(), _rs);
return _qds;
} finally {
if ( (_qds != null) && (_qds.isOpen()) ) {
_qds.close();
}
_qds = null;
}
} else {
return null;
}
ivan.lusavec@inet.hr wrote:
> Hi.I have a problem with passing input parameters to Firebird procedure,
> more exactly I don't know how to do it at all with dataexpress components.I
> used procedures succesfully when there are no input parameters, although the
> query string is very strange, I just put name of select procedure and it is
> working.No "select * from procedurename", just "procedurename", so does
> someone now how to add a parameter to call.I am just interested in right
> syntax, I will find my way with setting parameter with parameterRow...That's
> my problem....how to paramaterize call...bye...
>
>
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
http://www.microps.com/mps/paperFAQ.html
====================================================
Technical Details
Message-ID:
<4325cd70$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!pd7cy1no!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4321d338@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,dac42bce09fbfa83 X-Google-Attributes: gid1073da,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 12 Sep 2005 11:49:55 -0700 From: John Moore <jbm@microps.com> User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.database Subject: Re: ProcedureDataSet and Firebird References: <4321d338@newsgroups.borland.com> In-Reply-To: <4321d338@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 207.137.13.178 Message-ID: <4325cd70$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1126550896 207.137.13.178 (12 Sep 2005 11:48:16 -0700) Lines: 65 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!pd7cy1no!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail