Wednesday, April 26th, 2017

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 [...]

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; } [...]

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 [...]

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;}”) [...]

Javascript trim function Javascript trim function function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,””); } Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post

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 = [...]

Secure Linux Web Hosting