<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>StudyJava.org &#187; Client Side  Scripts</title>
	<atom:link href="http://studyjava.org/category/client-side-scripts/feed" rel="self" type="application/rss+xml" />
	<link>http://studyjava.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 05 Apr 2010 11:49:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Convert String to Blob and Blob to String</title>
		<link>http://studyjava.org/client-side-scripts/convert-string-to-blob-and-blob-to-string</link>
		<comments>http://studyjava.org/client-side-scripts/convert-string-to-blob-and-blob-to-string#comments</comments>
		<pubDate>Mon, 23 Nov 2009 15:14:37 +0000</pubDate>
		<dc:creator>rathi</dc:creator>
				<category><![CDATA[Client Side  Scripts]]></category>
		<category><![CDATA[Blob to String]]></category>
		<category><![CDATA[Convert String to Blob]]></category>
		<category><![CDATA[String to Blob]]></category>

		<guid isPermaLink="false">http://studyjava.org/?p=313</guid>
		<description><![CDATA[Convert String to Blob String data = &#8220;hello world&#8221;; 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 [...]]]></description>
			<content:encoded><![CDATA[<p>Convert String to Blob</p>
<p>String data = &#8220;hello world&#8221;;<br />
java.sql.Blob blob = org.hibernate.Hibernate.createBlob(data.getBytes());</p>
<p>Convert Blob to String</p>
<p>byte[] bdata = blob.getBytes(1, (int)blob.length());<br />
String data1 = new String(bdata);</p>
<p>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 types.</p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fconvert-string-to-blob-and-blob-to-string', 'Convert+String+to+Blob+and+Blob+to+String')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fconvert-string-to-blob-and-blob-to-string', title: '+Convert+String+to+Blob+and+Blob+to+String+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://studyjava.org/client-side-scripts/convert-string-to-blob-and-blob-to-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable or Enabel all links</title>
		<link>http://studyjava.org/client-side-scripts/disable-or-enambel-all-links</link>
		<comments>http://studyjava.org/client-side-scripts/disable-or-enambel-all-links#comments</comments>
		<pubDate>Fri, 09 Oct 2009 11:57:31 +0000</pubDate>
		<dc:creator>rathi</dc:creator>
				<category><![CDATA[Client Side  Scripts]]></category>
		<category><![CDATA[Disable or Enambel all links]]></category>

		<guid isPermaLink="false">http://studyjava.org/?p=281</guid>
		<description><![CDATA[window.onload= function(){ DisableEnableLinks(true) } function DisableEnableLinks(xHow){ objLinks = document.links; for(i=0;i&#60;objLinks.length;i++){ objLinks[i].disabled = xHow; //link with onclick if(objLinks[i].onclick &#38;&#38; xHow){ objLinks[i].onclick = new Function(&#8220;return false;&#8221; + 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 &#38;&#38; objLinks[i].onclick.toString().indexOf(&#8220;function(){return false;}&#8221;) != -1){ objLinks[i].onclick = null; } [...]]]></description>
			<content:encoded><![CDATA[<p>window.onload= function(){<br />
DisableEnableLinks(true)<br />
}</p>
<p>function DisableEnableLinks(xHow){<br />
objLinks = document.links;<br />
for(i=0;i&lt;objLinks.length;i++){<br />
objLinks[i].disabled = xHow;<br />
//link with onclick<br />
if(objLinks[i].onclick &amp;&amp; xHow){<br />
objLinks[i].onclick = new Function(&#8220;return false;&#8221; + objLinks[i].onclick.toString().getFuncBody());<br />
}<br />
//link without onclick<br />
else if(xHow){<br />
objLinks[i].onclick = function(){return false;}<br />
}<br />
//remove return false with link without onclick<br />
else if(!xHow &amp;&amp; objLinks[i].onclick.toString().indexOf(&#8220;function(){return false;}&#8221;) != -1){<br />
objLinks[i].onclick = null;<br />
}<br />
//remove return false link with onclick<br />
else if(!xHow &amp;&amp; objLinks[i].onclick.toString().indexOf(&#8220;return false;&#8221;) != -1){<br />
strClick = objLinks[i].onclick.toString().getFuncBody().replace(&#8220;return false;&#8221;,&#8221;")<br />
objLinks[i].onclick = new Function(strClick);<br />
}<br />
}<br />
}</p>
<p>String.prototype.getFuncBody = function(){<br />
var str=this.toString();<br />
str=str.replace(/[^{]+{/,&#8221;");<br />
str=str.substring(0,str.length-1);<br />
str = str.replace(/\n/gi,&#8221;");<br />
if(!str.match(/\(.*\)/gi))str += &#8220;)&#8221;;<br />
return str;<br />
}</p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fdisable-or-enambel-all-links', 'Disable+or+Enabel+all+links')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fdisable-or-enambel-all-links', title: '+Disable+or+Enabel+all+links+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://studyjava.org/client-side-scripts/disable-or-enambel-all-links/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>startsWith and endsWith functions in Javascript</title>
		<link>http://studyjava.org/client-side-scripts/startswith-and-endswith-functions-in-javascript</link>
		<comments>http://studyjava.org/client-side-scripts/startswith-and-endswith-functions-in-javascript#comments</comments>
		<pubDate>Fri, 02 Oct 2009 16:51:59 +0000</pubDate>
		<dc:creator>rathi</dc:creator>
				<category><![CDATA[Client Side  Scripts]]></category>
		<category><![CDATA[endsWith]]></category>
		<category><![CDATA[startsWith]]></category>

		<guid isPermaLink="false">http://studyjava.org/?p=233</guid>
		<description><![CDATA[startsWith and endsWith functions in Javascript inside the Javascript tag, startsWith to check if a string starts with a particular character sequecnce: var data = &#8220;Helloo Good Morning&#8221;; startsWith String.prototype.startsWith = function(data) { return (this.match(&#8220;^&#8221;+data)==data) } eg: data.startsWith(&#8220;Helloo&#8221;); returns true endsWith Function endsWith to check if a string ends with a particular character sequecnce: String.prototype.endsWith [...]]]></description>
			<content:encoded><![CDATA[<p><strong>startsWith and endsWith functions in Javascript</strong></p>
<p>inside the Javascript tag,</p>
<p><strong>startsWith</strong> to check if a string starts with a particular character sequecnce:</p>
<p>var data = &#8220;Helloo Good Morning&#8221;;<br />
startsWith<br />
String.prototype.startsWith = function(data)<br />
{<br />
return (this.match(&#8220;^&#8221;+data)==data)<br />
}</p>
<p>eg:<br />
data.startsWith(&#8220;Helloo&#8221;);<br />
returns true</p>
<p><strong>endsWith</strong> Function</p>
<p>endsWith to check if a string ends with a particular character sequecnce:</p>
<p>String.prototype.endsWith = function(data)<br />
{<br />
return (this.match(data+&#8221;$&#8221;)==data)<br />
}</p>
<p>eg:<br />
data.endsWith(&#8220;Helloo&#8221;);<br />
returns false;</p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fstartswith-and-endswith-functions-in-javascript', 'startsWith+and+endsWith+functions+in+Javascript')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fstartswith-and-endswith-functions-in-javascript', title: '+startsWith+and+endsWith+functions+in+Javascript+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://studyjava.org/client-side-scripts/startswith-and-endswith-functions-in-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable all links using javascript</title>
		<link>http://studyjava.org/client-side-scripts/disable-all-links-using-javascript</link>
		<comments>http://studyjava.org/client-side-scripts/disable-all-links-using-javascript#comments</comments>
		<pubDate>Fri, 25 Sep 2009 04:16:07 +0000</pubDate>
		<dc:creator>rathi</dc:creator>
				<category><![CDATA[Client Side  Scripts]]></category>
		<category><![CDATA[Disable all links]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://studyjava.org/?p=235</guid>
		<description><![CDATA[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 &#38;&#38; objLinks[i].onclick = new Function(&#8220;return false;&#8221; + 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 &#38;&#38; objLinks[i].onclick.toString().indexOf(&#8220;function(){return false;}&#8221;) [...]]]></description>
			<content:encoded><![CDATA[<p>Disable all links using javascript</p>
<p>function DisableEnableLinks(xHow){<br />
objLinks = document.links;<br />
for(i=0;i</p>
<p>objLinks[i].disabled = xHow;<br />
//link with onclick<br />
if(objLinks[i].onclick and xHow){ //replace the and by &amp;&amp;<br />
objLinks[i].onclick = new Function(&#8220;return false;&#8221; + objLinks[i].onclick.toString().getFuncBody());<br />
}<br />
//link without onclick<br />
else if(xHow){<br />
objLinks[i].onclick = function(){return false;}<br />
}<br />
//remove return false with link without onclick<br />
else if(!xHow &amp;&amp; objLinks[i].onclick.toString().indexOf(&#8220;function(){return false;}&#8221;) != -1){<br />
objLinks[i].onclick = null;<br />
}<br />
//remove return false link with onclick<br />
else if(!xHow &amp;&amp; objLinks[i].onclick.toString().indexOf(&#8220;return false;&#8221;) != -1){<br />
strClick = objLinks[i].onclick.toString().getFuncBody().replace(&#8220;return false;&#8221;,&#8221;");<br />
objLinks[i].onclick = new Function(strClick);<br />
}</p>
<p>}<br />
}</p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fdisable-all-links-using-javascript', 'Disable+all+links+using+javascript')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fdisable-all-links-using-javascript', title: '+Disable+all+links+using+javascript+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://studyjava.org/client-side-scripts/disable-all-links-using-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>javascript trim function</title>
		<link>http://studyjava.org/client-side-scripts/javascript-trim-function</link>
		<comments>http://studyjava.org/client-side-scripts/javascript-trim-function#comments</comments>
		<pubDate>Thu, 17 Sep 2009 03:04:41 +0000</pubDate>
		<dc:creator>rathi</dc:creator>
				<category><![CDATA[Client Side  Scripts]]></category>

		<guid isPermaLink="false">http://studyjava.org/?p=193</guid>
		<description><![CDATA[Javascript trim function Javascript trim function function trim(stringToTrim) { return stringToTrim.replace(/^\s+&#124;\s+$/g,&#8221;"); }]]></description>
			<content:encoded><![CDATA[<p>Javascript trim function</p>
<p>Javascript trim function</p>
<p>function</p>
<p>trim(stringToTrim) {</p>
<p>return<br />
stringToTrim.replace(/^\s+|\s+$/g,&#8221;");</p>
<p>}</p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fjavascript-trim-function', 'javascript+trim+function')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fstudyjava.org%2Fclient-side-scripts%2Fjavascript-trim-function', title: '+javascript+trim+function+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://studyjava.org/client-side-scripts/javascript-trim-function/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stream has already been closed; nested exception is java.sql.SQLException in Oracle.</title>
		<link>http://studyjava.org/general/stream-has-already-been-closed-nested-exception-is-java-sql-sqlexception-in-oracle</link>
		<comments>http://studyjava.org/general/stream-has-already-been-closed-nested-exception-is-java-sql-sqlexception-in-oracle#comments</comments>
		<pubDate>Tue, 15 Sep 2009 03:03:02 +0000</pubDate>
		<dc:creator>rathi</dc:creator>
				<category><![CDATA[Client Side  Scripts]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[java.sql.SQLException in Oracle]]></category>
		<category><![CDATA[nested exception]]></category>
		<category><![CDATA[Stream has already been closed]]></category>

		<guid isPermaLink="false">http://studyjava.org/?p=190</guid>
		<description><![CDATA[Stream has already been closed; nested exception is java.sql.SQLException in Oracle In this sample code, an exception occured i.e &#8220;Stream has already been closed; nested exception is java.sql.SQLException&#8221;, In case java &#8211; Oracle connectivity this kind of exception thrown out. Reason for this exception, the table contains a datatype (long) field. sample code selProcess = [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Stream has already been closed; nested exception is java.sql.SQLException in Oracle</strong></p>
<p>In this sample code, an exception occured i.e &#8220;Stream has already been closed; nested exception is java.sql.SQLException&#8221;, In case java &#8211; Oracle connectivity this kind of exception thrown out. Reason for this exception, the table contains a datatype (long) field.</p>
<p><strong>sample code</strong></p>
<p>selProcess = conn.prepareStatement  (&#8220;select data(this is Long raw column),<br />
intername, transid, transorder, errorcount, emailsent from max_interdata<br />
order by transid, transorder, rowstamp&#8221;);</p>
<p>ResultSet rsetMax = selProcess.executeQuery();</p>
<p>try<br />
{<br />
while (rsetMax.next())<br />
{</p>
<p>//08/15/02, JB &#8212; using getBinaryStream() instead<br />
of getBytes() to<br />
//work around Oracle driver bug<br />
InputStream inputStream = null;<br />
try<br />
{<br />
inputStream = rsetMax.getBinaryStream(1);<br />
data = readBinaryData(inputStream);<br />
// method to convert the inputsream to my object<br />
interfaceName = rsetMax.getString(2);<br />
transID = rsetMax.getLong(3);<br />
transOrder = rsetMax.getLong(4);<br />
errorCount = rsetMax.getInt(5);<br />
emailSent =  rsetMax.getString(6);<br />
}</p>
<p>000.         000: String.java.lang.String:Stack trace:<br />
java.sql.SQLException: Stream has already been closed<br />
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)<br />
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)<br />
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)<br />
at<br />
oracle.jdbc.dbaccess.DBDataSetImpl.getStreamItem(DBDataSetImpl.java:1145)<br />
at<br />
oracle.jdbc.driver.OracleStatement.getBinaryStreamValue(OracleStatement.java:4616)<br />
at<br />
oracle.jdbc.driver.OracleResultSetImpl.getBinaryStream(OracleResultSetImpl.java:398)<br />
at<br />
psdi.iface.interdata.MaxInterDataBatch.processInterData(MaxInterDataBatch.java:150)<br />
at<br />
psdi.iface.mic.MicService$PollMaxInterdataBatch.run(MicService.java:1723)<br />
at java.lang.Thread.run(Thread.java:484)<br />
<strong>For example:</strong></p>
<p>&#8216;Customer is the table name contains a field &#8216;order&#8217; long datatype</p>
<p>To solve this exception, replace the datatype &#8216;<strong>long</strong>&#8216; field to &#8216;<strong>number</strong>&#8216; datatype</p>
<div id="st0000000001" class="st-taf"><script src="http://taf.socialtwist.com:80/taf/js/shoppr.core.js?id=0000000001"></script><img style="border:0;margin:0;padding:0;" src="http://tellafriend.socialtwist.com:80/wizard/images/tafbutton_blue16.png" onmouseout="hideHoverMap(this)" onmouseover="showHoverMap(this, '0000000001', 'http%3A%2F%2Fstudyjava.org%2Fgeneral%2Fstream-has-already-been-closed-nested-exception-is-java-sql-sqlexception-in-oracle', 'Stream+has+already+been+closed%3B+nested+exception+is+java.sql.SQLException+in+Oracle.')" onclick="cw(this, {id:'0000000001',link: 'http%3A%2F%2Fstudyjava.org%2Fgeneral%2Fstream-has-already-been-closed-nested-exception-is-java-sql-sqlexception-in-oracle', title: '+Stream+has+already+been+closed%3B+nested+exception+is+java.sql.SQLException+in+Oracle.+' })"/></div>]]></content:encoded>
			<wfw:commentRss>http://studyjava.org/general/stream-has-already-been-closed-nested-exception-is-java-sql-sqlexception-in-oracle/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

