Convert String to Blob
String data = “hello world”;
java.sql.Blob blob = org.hibernate.Hibernate.createBlob(data.getBytes());
Convert Blob to String
byte[] bdata = blob.getBytes(1, (int)blob.length());
String data1 = new String(bdata);
if the length of blob exceeds the maxvalue for the int, then u can use CLOB format.To store large data we can use CLOB format and to store an image, use a BLOB data [...]
window.onload= function(){
DisableEnableLinks(true)
}
function DisableEnableLinks(xHow){
objLinks = document.links;
for(i=0;i<objLinks.length;i++){
objLinks[i].disabled = xHow;
//link with onclick
if(objLinks[i].onclick && xHow){
objLinks[i].onclick = new Function(“return false;” + objLinks[i].onclick.toString().getFuncBody());
}
//link without onclick
else if(xHow){
objLinks[i].onclick = function(){return false;}
}
//remove return false with link without onclick
else if(!xHow && objLinks[i].onclick.toString().indexOf(“function(){return false;}”) != -1){
objLinks[i].onclick = null;
}
//remove return false link with onclick
else if(!xHow && objLinks[i].onclick.toString().indexOf(“return false;”) != -1){
strClick = objLinks[i].onclick.toString().getFuncBody().replace(“return false;”,””)
objLinks[i].onclick = new Function(strClick);
}
}
}
String.prototype.getFuncBody = [...]
startsWith and endsWith functions in Javascript
inside the Javascript tag,
startsWith to check if a string starts with a particular character sequecnce:
var data = “Helloo Good Morning”;
startsWith
String.prototype.startsWith = function(data)
{
return (this.match(“^”+data)==data)
}
eg:
data.startsWith(“Helloo”);
returns true
endsWith Function
endsWith to check if a string ends with a particular character sequecnce:
String.prototype.endsWith = function(data)
{
return (this.match(data+”$”)==data)
}
eg:
data.endsWith(“Helloo”);
returns false;
Disable all links using javascript
function DisableEnableLinks(xHow){
objLinks = document.links;
for(i=0;i
objLinks[i].disabled = xHow;
//link with onclick
if(objLinks[i].onclick and xHow){ //replace the and by &&
objLinks[i].onclick = new Function(“return false;” + objLinks[i].onclick.toString().getFuncBody());
}
//link without onclick
else if(xHow){
objLinks[i].onclick = function(){return false;}
}
//remove return false with link without onclick
else if(!xHow && objLinks[i].onclick.toString().indexOf(“function(){return false;}”) != -1){
objLinks[i].onclick = null;
}
//remove return false link with onclick
else if(!xHow && objLinks[i].onclick.toString().indexOf(“return false;”) != [...]
Javascript trim function
Javascript trim function
function
trim(stringToTrim) {
return
stringToTrim.replace(/^\s+|\s+$/g,””);
}
Stream has already been closed; nested exception is java.sql.SQLException in Oracle
In this sample code, an exception occured i.e “Stream has already been closed; nested exception is java.sql.SQLException”, In case java – Oracle connectivity this kind of exception thrown out. Reason for this exception, the table contains a datatype (long) field.
sample code
selProcess = conn.prepareStatement (“select data(this [...]

