Try OpenEdge Now
skip to main content
SQL Reference
JDBC Reference : Java Class Reference : SQLIStatement : SQLIStatement.setParam : Throws
 
Throws
DhSQLException

Example

This code fragment illustrates the setParam method:
CREATE PROCEDURE sps_setParam()
BEGIN
// Assign local variables to be used as
// SQL input parameter references
Integer ins_fld_ref = new Integer(1);
Integer ins_small_fld = new Integer(3200);
Integer ins_int_fld = new Integer(21474);
Double ins_doub_fld = new Double(1.797E+30);
String ins_char_fld = new String("Athula");
String ins_vchar_fld = new String("Scientist");
Float ins_real_fld = new Float(17);
SQLPStatement insert_sfns1 = new SQLPStatement ("INSERT INTO sfns
(fld_ref,small_fld,int_fld,doub_fld,char_fld,vchar_fld)
values (?,?,?,?,?,?)" );
insert_sfns1.setParam(1,ins_fld_ref);
insert_sfns1.setParam(2,ins_small_fld);
insert_sfns1.setParam(3,ins_int_fld);
insert_sfns1.setParam(4,ins_doub_fld);
insert_sfns1.setParam(5,ins_char_fld);
insert_sfns1.setParam(6,ins_vchar_fld);
insert_sfns1.execute();
END