<?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>Tork Wrench &#187; jdbc</title>
	<atom:link href="http://www.torkwrench.com/tag/jdbc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.torkwrench.com</link>
	<description>Things I learnt today, working on IBM Lotus Web Content Management.</description>
	<lastBuildDate>Tue, 17 Aug 2010 06:50:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Tips for changing your Portal datasources</title>
		<link>http://www.torkwrench.com/2009/08/04/tips-for-changing-your-portal-datasources/</link>
		<comments>http://www.torkwrench.com/2009/08/04/tips-for-changing-your-portal-datasources/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 05:33:09 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[tip]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[WebSphere Portal]]></category>
		<category><![CDATA[XAER_RMERR]]></category>

		<guid isPermaLink="false">http://www.torkwrench.com/?p=128</guid>
		<description><![CDATA[How to edit the portal datasources and meet off potential transaction log problems if they arise. <a href="http://www.torkwrench.com/2009/08/04/tips-for-changing-your-portal-datasources/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For some reason, we&#8217;ve got a test system that is hooked up to a db2 database that is using DHCP. This would be ok if Portal was configured to talk to the hostname of the database server, but it&#8217;s using the IP. So the inevitable happened and the IP of the database changed and the Portal server went down. </p>
<p>So the obvious fix is to change the datasource so it&#8217;s using the hostname of the database server, rather than the ip (or set a static IP for the database server, but that wouldn&#8217;t really require a whole blog post now would it!).</p>
<p>To do this, fire up the WAS admin console and navigate to datasources. </p>
<p><img src="http://www.torkwrench.com/wp-content/uploads/2009/08/datasources.png" alt="datasources" title="datasources" width="651" height="773" class="aligncenter size-full wp-image-129" /></p>
<p>Your list of datasources might be different to mine, depending on your database, but the principles are the same.</p>
<p>Go into each datasource and at the bottom you will see a properties dialog. Change the old IP to a hostname.</p>
<div id="attachment_130" class="wp-caption aligncenter" style="width: 353px"><img src="http://www.torkwrench.com/wp-content/uploads/2009/08/ds-props.png" alt="change the IP to a hostname" title="ds-props" width="343" height="181" class="size-full wp-image-130" /><p class="wp-caption-text">change the IP</p></div>
<p>All of them need to be changed, so go back into each one and change it. Now run the test, by selecting each one and clicking the test connection button.</p>
<p>You should get a message like this: </p>
<div id="attachment_131" class="wp-caption aligncenter" style="width: 642px"><img src="http://www.torkwrench.com/wp-content/uploads/2009/08/test-connection.png" alt="successful test connection message" title="test-connection" width="632" height="140" class="size-full wp-image-131" /><p class="wp-caption-text">successful test connection message</p></div>
<p>Now start Portal. Hmm, I get this when I try to go to the site&#8230;.</p>
<p>&#8221; Error 404: Initialization of one or more services failed. &#8221;</p>
<p>Check the SystemOut.log :</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Caused by: com.ibm.websphere.ce.cm.StaleConnectionException: [ibm][db2][jcc][t4][2043][11550] Exception java.net.SocketException: Error opening socket to server /9.185.226.121 on port 50,000 with message: Operation timed out: connect:could be due to invalid address.DSRA0010E: SQL State = null, Error Code = -4,499<br />
<br />
&nbsp; &nbsp; at sun.reflect.GeneratedConstructorAccessor64.newInstance(Unknown Source)<br />
<br />
&nbsp; &nbsp; at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)<br />
<br />
&nbsp; &nbsp; at java.lang.reflect.Constructor.newInstance(Constructor.java:522)<br />
<br />
&nbsp; &nbsp; at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapExceptionHelper(GenericDataStoreHelper.java:523)<br />
<br />
&nbsp; &nbsp; at com.ibm.websphere.rsadapter.GenericDataStoreHelper.mapException(GenericDataStoreHelper.java:578)<br />
<br />
&nbsp; &nbsp; at com.ibm.ws.rsadapter.AdapterUtil.mapException(AdapterUtil.java:2159)<br />
<br />
&nbsp; &nbsp; ... 11 more</div></div>
<p>Hang on, the datasource test worked? Why won&#8217;t the server start? It looks like it&#8217;s using the old database server IP still!</p>
<p>The answer lies in the transaction logs that WAS uses. These binary log files contain XA transactions that might not have been executed yet. You should take care when messing about with these files &#8211; they are there for a reason. But on the other hand, the server won&#8217;t start now, so we can hardly make things worse, can we <img src='http://www.torkwrench.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> ) . Stop the server1 and WebSphere_Portal application servers and go to your wp_profile directory. Delete the contents of the tranlog and recoverylogs directories and try to start the server again.</p>
<p>This message should appear in SystemOut :</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[4/08/09 15:23:16:825 EST] 00000012 LogHandle &nbsp; &nbsp; I &nbsp; CWRLS0007I: No existing recovery log files found in C:/WebSphere/wp_profile\tranlog\win61\win61\WebSphere_Portal\transaction\tranlog. Cold starting the recovery log.<br />
<br />
[4/08/09 15:23:16:825 EST] 00000012 LogFileHandle I &nbsp; CWRLS0006I: Creating new recovery log file C:/WebSphere/wp_profile\tranlog\win61\win61\WebSphere_Portal\transaction\tranlog\log1.<br />
<br />
[4/08/09 15:23:16:841 EST] 00000012 LogFileHandle I &nbsp; CWRLS0006I: Creating new recovery log file C:/WebSphere/wp_profile\tranlog\win61\win61\WebSphere_Portal\transaction\tranlog\log2.<br />
<br />
[4/08/09 15:23:16:856 EST] 00000012 LogHandle &nbsp; &nbsp; I &nbsp; CWRLS0007I: No existing recovery log files found in C:/WebSphere/wp_profile\tranlog\win61\win61\WebSphere_Portal\transaction\partnerlog. Cold starting the recovery log.<br />
<br />
[4/08/09 15:23:16:856 EST] 00000012 LogFileHandle I &nbsp; CWRLS0006I: Creating new recovery log file C:/WebSphere/wp_profile\tranlog\win61\win61\WebSphere_Portal\transaction\partnerlog\log1.<br />
<br />
[4/08/09 15:23:16:856 EST] 00000012 LogFileHandle I &nbsp; CWRLS0006I: Creating new recovery log file C:/WebSphere/wp_profile\tranlog\win61\win61\WebSphere_Portal\transaction\partnerlog\log2.<br />
<br />
[4/08/09 15:23:16:903 EST] 00000012 RecoveryManag A &nbsp; WTRN0028I: Transaction service recovering 0 transactions.</div></div>
<p>Success, now the server will start up!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkwrench.com/2009/08/04/tips-for-changing-your-portal-datasources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking the version of the Oracle JDBC driver jar</title>
		<link>http://www.torkwrench.com/2009/03/20/checking-the-version-of-the-oracle-jdbc-driver-jar/</link>
		<comments>http://www.torkwrench.com/2009/03/20/checking-the-version-of-the-oracle-jdbc-driver-jar/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 08:38:47 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[websphere]]></category>

		<guid isPermaLink="false">http://www.torkwrench.com/?p=22</guid>
		<description><![CDATA[How to check if you have the right version of the Oracle driver installed to use with WebSphere Portal. Two methods of checking this are discussed. <a href="http://www.torkwrench.com/2009/03/20/checking-the-version-of-the-oracle-jdbc-driver-jar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a problem now where we need to use the Oracle 10g driver against a 9i database.<a href="http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/topic/com.ibm.wp.ent.doc/wpf/inst_req60.html?resultof=%22%6f%72%61%63%6c%65%22%20%22%6f%72%61%63%6c%22%20%22%31%30%22%20%22%64%72%69%76%65%72%22%20"> There&#8217;s a note in the infocenter about it</a> .But how to do you check which version of the driver you are using ? The filename of the driver is the same between each version of Oracle (ojdbc14.jar), so that&#8217;s not going to do it.</p>
<p>To check it out, unzip the driver and read the META-INF/MANIFEST.MF file. Here&#8217;s mine:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Manifest-Version: 1.0<br />
Specification-Title:    Oracle JDBC driver classes for use with JDK14<br />
Sealed: true<br />
Created-By: 1.4.2_08 (Sun Microsystems Inc.)<br />
Implementation-Title:   ojdbc14.jar<br />
Specification-Vendor:   Oracle Corporation<br />
Specification-Version:  Oracle JDBC Driver version - &quot;10.2.0.3.0&quot;<br />
Implementation-Version: Oracle JDBC Driver version - &quot;10.2.0.3.0&quot;<br />
Implementation-Vendor:  Oracle Corporation<br />
Implementation-Time:    Fri Sep 29 09:43:24 2006</div></div>
<p>Also Portal (and regular ol&#8217; Appserver) will tell you as they initialize in the SystemOut.log, just try this trusty command :</p>
<p><strong>cat SystemOut.log | grep -A 2 &#8220;Oracle JDBC&#8221;</strong></p>
<p>and you get back something like :</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[3/20/09 2:44:21:570 EDT] 0000001f InternalOracl I   DSRA8205I: JDBC driver name  : Oracle JDBC driver<br />
[3/20/09 2:44:21:572 EDT] 0000001f InternalOracl I   DSRA8206I: JDBC driver version  : 9.2.0.8.0<br />
[3/20/09 2:44:21:575 EDT] 0000001f InternalOracl I   DSRA8212I: DataStoreHelper name is: com.ibm.websphere.rsadapter.OracleDataStoreHelper@39136937.</div></div>
<p>What! 9.2.0.8! Looks like I&#8217;ve got the wrong one on there. <img src='http://www.torkwrench.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkwrench.com/2009/03/20/checking-the-version-of-the-oracle-jdbc-driver-jar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
