-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Retrieve the lenght of text/blob fron a db
PostPosted: Sun Mar 07, 2004 4:22 am 
Newbie

Joined: Fri Nov 28, 2003 6:20 am
Posts: 3
How do I simply retrieve the length of a text/blob record from a database? I see the LENGTH function associated with the WHERE clause but I don't see how to say 'give me the lenght of this record'.

Thanx,
Allan Clearwaters


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 07, 2004 7:34 am 
Beginner
Beginner

Joined: Thu Jan 08, 2004 4:40 am
Posts: 48
Location: Bangkok, Thailand
For me I always do something like this
public class HibernateLimousine implements Limousine , Serializable {

private Long limousineId;
private String limousineType;
private String description;
private Double rate;
private Blob picture;
private String fileName;
private int fileSize;


Get file size from application layer and keep it in DB, so this would be easier for me......
Cheers

_________________
<name>arin</name>
<at>netplus software</at>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 09, 2004 1:52 pm 
Beginner
Beginner

Joined: Thu Jan 01, 2004 11:36 am
Posts: 23
Location: Belgium
Allan,

I use something like this:


Report report = (Report) session.load(Report.class, id);
Blob blob = report.getData(); // getter mapped to a blob
long blobLength = blob.length();
...

Jan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.