Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

calling stored procedures in Sybase from java

843859Jul 23 2007 — edited Aug 7 2007
Hi,

I am using the following stored procedure in Sybase

use xyzdb
go

-- drop procedure if it already exist
if object_id('up_name_select') is not null
begin
drop procedure up_name_select
end
go

create procedure up_name_select
@zid numeric(7,0),
@firstname char(40),
@lastname char(40)

as

select zid,
firstname,
lastname
from name
where zid = @zid or
(lastname like @lastname or firstname like @firstname)
go

-- update documentation records in object_docs
delete object_docs
from object_docs
where object_name = "up_name_select"
go

insert into object_docs values("up_name_select","Selects records from the name table based upon the values of the input parameters.")
go

-- update documentation records in column_docs
delete column_docs
from column_docs
where object_name = "up_name_select"
go

insert into column_docs values("up_name_select","@zid","System generated ID for an individual contact.")
insert into column_docs values("up_name_select","@firstname","First name of the contact. SQL wild card characters are accepted.")
insert into column_docs values("up_name_select","@lastname","Last name of the contact. SQL wild card characters are accepted.")
go

-- print success message and grant permissions
if object_id('up_name_select') is not null
begin
print "Procedure up_name_select created."
grant execute on up_name_select to developer_role
end
go


This stored procedure selects the values from the table "name" for a given where condition (if I am not wrong).

Can any one give me sample java code to select the records from the table "name" for a given zid.

Thankyou in advance.

Regards

sgatl2
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2007
Added on Jul 23 2007
1 comment
541 views