steve chu
Posts: 14
Nickname: chuchutrai
Registered: Nov, 2005
|
|
Re: calling a stored procedure on AS400
|
Posted: Dec 7, 2005 12:17 AM
|
|
this is what i came up with. assuming that the procedure getlabinfo is in the folder QGPL
try { AS400JDBCDriver d = new AS400JDBCDriver(); AS400 o = new AS400("xxx.xxx.xxx.xxx", username, password); Connection c = d.connect (o);
CallableStatement cs = c.prepareCall( "call QGPL.getlabinfo(?,?,?,?,?,?,?,?,?,?)" ); cs.setString(1, Fname); cs.registerOutParameter(2, Types.VARCHAR); cs.registerOutParameter(3, Types.VARCHAR); cs.registerOutParameter(4, Types.VARCHAR); cs.registerOutParameter(5, Types.VARCHAR); cs.registerOutParameter(6, Types.VARCHAR); cs.registerOutParameter(7, Types.VARCHAR); cs.registerOutParameter(8, Types.VARCHAR); cs.registerOutParameter(9, Types.VARCHAR); cs.registerOutParameter(10, Types.VARCHAR); cs.execute(); } catch(Exception) {}
|
|