The JDBCExamples class uses the Address class shown in “Sample Java classes”. To execute these examples on your machine, install the Address class on the server and include it in the Java CLASSPATH of the jConnect client.
You can call the methods of JDBCExamples from either a jConnect client or Adaptive Server.
You must create or drop stored procedures from the jConnect client. The Adaptive Server native driver does not support create procedure and drop procedure statements.
JDBCExamples static methods perform the following SQL operations:
Create and drop an example table, xmp:
create table xmp (id int, name varchar(50), home Address)
Create and drop a sample stored procedure, inoutproc:
create procedure inoutproc @id int, @newname varchar(50), @newhome Address, @oldname varchar(50) output, @oldhome Address output as
select @oldname = name, @oldhome = home from xmp where id=@id
update xmp set name=@newname, home = @newhome where id=@id
Insert a row into the xmp table.
Select a row from the xmp table.
Update a row of the xmp table.
Call the stored procedure inoutproc, which has both input parameters and output parameters of datatypes java.lang.String and Address.
JDBCExamples operates only on the xmp table and inoutproc procedure.