Jianhong,
The mechanism for executing stored procs in java is a callable statment. At
the most basic level you need to :
1. get a connection (I assume you have this, from your comment about the ODBC
bridge)
2. create a callable statement from the connection using the DBMS independent
calling pseudocode
e.g.cs = conn.prepareCall ( {call (?, ?, ? ) } ; // 3 ? one for each of
your parameters
3. specify the parameters (if any)
e.g. cs.setInt (1, x) ; // where x is your integer value for parameter 1
//another setInt
// a setString
4. call the statement
e.g. cs.executeQuery // or executeUpdate as appropriate
Hope this helps,
The sun tutorial for JDBC is pretty good as a starter, also the api docs
ellaborate on the callable statement class.
Jianhong wrote:
> Hi,
>
> I have a stored procedure, but I don't know how to run and get
> result from it using JDBC-ODBC bridge. The following is the
> procedure, any help would be very appreciated.
>
> create procedure proc_1
> (@siteID int, @catID int, @result char(200) output) as
> select @result = siteURL from classifiedSite
> where siteID = @siteID and catID = @catID
>
> Jianhong
>
> - att1.htm
>
> ------------------------------------------------------------------------
> Name: att1.htm
> att1.htm Type: Hypertext Markup Language (text/html)
> Encoding: quoted-printable
--
Tim Stephenson
-----------------------------------------------------------
e: [EMAIL PROTECTED] or [EMAIL PROTECTED]
m: +44 7775 66 00 58
h: +44 207 254 5196
v: +44 1628 597279
-----------------------------------------------------------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html