。
cmd.setString("Title","孟宪会");
cmd.setString("Guid",Guid.toString());
cmd.setString("BirthDate","2007-9-9");
cmd.setDate("BirthDate",rightNow);
cmd.setString("Description","【孟子E章】");
cmd.setBinaryStream("Photo",f,f.available());
cmd.setString("Other",null);
cmd.registerOutParameter(1,java.sql.Types.INTEGER);
cmd.registerOutParameter("UserID",java.sql.Types.INTEGER);
cmd.execute();
int returnValue = cmd.getInt(1);
int UserID = cmd.getInt("UserID");
if(returnValue == 1)
{
out.print("<li>添加成功!");
out.print("<li>UserID = " + UserID);
out.print("<li>returnValue = " + returnValue);
}
else
{
out.print("<li>添加失败!");
}
f.close();
}
catch(Exception ex)
{
out.print(ex.getLocalizedMessage());
}
finally
{
try
{
if(cmd != null)
{
cmd.close();
cmd = null;
}
if(cn != null)
{
cn.close();
cn = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
%>
</body>
</html>