private int UpdateImg( ImageStore img ){
/**
CREATE PROCEDURE [convertImgStoreUpdate] @width int ,@high int ,@typeflag2 tinyint,@ActualHeight int ,@ActualWidth int ,@OriginalSize bigint,
@SmallJpgSize bigint,@SmallJpgHeight int,@SmallJpgWidth int,
@SmallGifSize bigint,@SmallGifHeight int,@SmallGifWidth int,
@BigGifSize bigint,@BigGifHeight int,@BigGifWidth int,
@BigJpgSize bigint,@BigJpgHeight int,@BigJpgWidth int,
@ThumbGifSize bigint,@ThumbJpgSize bigint,
@url nvarchar(4000)
AS
update imgStore set Haslarge=1,Width=@width,High=@high,Fetchflag=2,typeflag=@typeflag2, Actual_Height=@ActualHeight ,Actual_Width=@ActualWidth, Original_Size=@OriginalSize
,SmallJpgSize=@SmallJpgSize,SmallJpgHeight=@SmallJpgHeight,SmallJpgWidth=@SmallJpgWidth
,SmallGifSize=@SmallGifSize,SmallGifHeight=@SmallGifHeight,SmallGifWidth=@SmallGifWidth
,BigGifSize=@BigGifSize,BigGifHeight=@BigGifHeight,BigGifWidth=@BigGifWidth
,BigJpgSize=@BigJpgSize,BigJpgHeight=@BigJpgHeight,BigJpgWidth=@BigJpgWidth
,ThumbGifSize=@ThumbGifSize,ThumbJpgSize=@ThumbJpgSize
where url=@url
GO
*/
try {
lock.lock();
PreparedStatement pre = getConnection().prepareStatement("Exec convertImgStoreUpdate2 ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
pre.setInt(1,img.getFetchflag().intValue());
pre.setInt(2,img.getHas176().intValue());
pre.setInt(3,img.getHas240().intValue());
pre.setInt(4,img.getTypeflag().intValue());
pre.setInt(5,img.getJpgWsrc().intValue());
pre.setLong(6,img.getJpgHsrc().intValue());
pre.setLong(7,img.getJpgSsrc().longValue());
pre.setInt(8,img.getGifS100().intValue());
pre.setInt(9,img.getGifH100().intValue());
pre.setLong(10,img.getGifW100().longValue());
pre.setInt(11,img.getJpgS100().intValue());
pre.setInt(12,img.getJpgH100().intValue());
pre.setLong(13,img.getJpgW100().longValue());
pre.setInt(14,img.getGifS128().intValue());
pre.setInt(15,img.getGifH128().intValue());
pre.setLong(16,img.getGifW128().longValue());
pre.setInt(17,img.getJpgS128().intValue());
pre.setInt(18,img.getJpgH128().intValue());
pre.setLong(19,img.getJpgW128().longValue());
pre.setInt(20,img.getGifS176().intValue());
pre.setInt(21,img.getGifH176().intValue());
pre.setLong(22,img.getGifW176().longValue());
pre.setInt(23,img.getJpgS176().intValue());
pre.setInt(24,img.getJpgH176().intValue());
pre.setLong(25,img.getJpgW176().longValue());
pre.setInt(26,img.getGifS240().intValue());
pre.setInt(27,img.getGifH240().intValue());
pre.setLong(28,img.getGifW240().longValue());
pre.setInt(29,img.getJpgS240().intValue());
pre.setInt(30,img.getJpgH240().intValue());
pre.setLong(31,img.getJpgW240().longValue());
// pre.setInt(14,img.getGifH176().intValue());
// pre.setInt(15,img.getGifW176().intValue());
//
// pre.setLong(16,img.getJpgS176().longValue());
// pre.setInt(17,img.getJpgH176().intValue());
// pre.setInt(18,img.getJpgW176().intValue());
//
// pre.setLong(19,img.getGifS100().longValue());
// pre.setLong(20,img.getJpgS100());
//
pre.setInt(32,img.getId());
return pre.executeUpdate();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
lock.unlock();
}
return 0;
}