2012年3月24日星期六

Vibram 5 Fingers SaleI use hibernate storage Blob image is found when this problem

I use hibernate storage Blob image is found when this problem, original picture byte is 2570, save to the Oracle database, byte into 2717, and use the HQL statement to get the blob object,Oakley Sunglasses, check out blob byte is still 2570,Monster Beats Tour, the image can be displayed properly, but the use of pure SQL read blob 2717,Monster Beats Sale, the image does not display, do not know what the reason is.
Oracle blob is oracle.sql.BLOB, procedures in the entity class BLOB type javax.sql.rowset.serial.SerialBlob,Vibram 5 Fingers Sale, does oracle.sql.BLOB converted to javax.sql.rowset.serial.SerialBlob need anything special? Hibernate is how to deal with both the conversion?Below is the hibernate configuration file in BLOB field mapping: < property name = "infPhoto" type = "javax.
sql.rowset.serial.SerialBlob" > < column name = "inf_photo" sql-type = "BLOB" / > / property> < infPhoto; from CmsInfo where rowId select = '1' for blob is 2570 the length of the blob, can display the picture, but the use of the pure SQL to obtain the blob length is 2717 (the length and stored in the Oracle database blob is of the same length): String SQL = "select inf_photo from cms_info where row_id = '" + this.
imageRowId + "."; Object obj1 = service.getJdbcTemplate (). QueryForObject (SQL,Moncler Jackets, Blob.class); if (obj1! = null) {Blob B = (Blob) obj1; logger.info (b.length ()); / / 2717 SerialBlob BB = new SerialBlob (b); logger.
info ("conversion 1:"); logger.info (bb.length ()); / / convert after 2717, do not know by what method to convert SerialBlob can be obtained after the original length?} which prawn knows this problem, thank you.
Related articles:

没有评论:

发表评论