<?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>thapole.net &#187; Java</title>
	<atom:link href="http://www.thapole.net/category/coding/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thapole.net</link>
	<description>this is the new shit</description>
	<lastBuildDate>Wed, 05 Aug 2009 22:13:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Integrate PostgreSQL Data Source in Websphere Application Server</title>
		<link>http://www.thapole.net/coding/java/2006/10/12/integrate-postgresql-data-source-in-websphere-application-server/</link>
		<comments>http://www.thapole.net/coding/java/2006/10/12/integrate-postgresql-data-source-in-websphere-application-server/#comments</comments>
		<pubDate>Thu, 12 Oct 2006 18:46:39 +0000</pubDate>
		<dc:creator>Thapole</dc:creator>
				<category><![CDATA[Java]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.thapole.net/?p=21</guid>
		<description><![CDATA[A short description about how to integrate a PostgreSQL database as WAS Datasource.]]></description>
			<content:encoded><![CDATA[<p>A quite unusual configuration but this short guidance might be useful for some persons (like me):</p>
<ol>
<li>Open Integrated Solution Console</li>
<li>Navigate to &#8220;Resources -> JDBC -> JDBC Providers&#8221;</li>
<li>Select the right scope for your application</li>
<li>Click &#8220;New&#8221;</li>
<li>Select &#8220;User-defined&#8221; from &#8220;Database Type&#8221; dropdown</li>
<li>Insert &#8220;org.postgresql.ds.PGConnectionPoolDataSource&#8221; at &#8220;Implementation class name&#8221;  field</li>
<li>Provide a name and a descriotion of your choice and click &#8220;next&#8221;</li>
<li>If you haven&#8217;t done so before download the JDBC Driver from <a href="http://jdbc.postgresql.org/download.html">http://jdbc.postgresql.org/download.html</a> which suits your needs (should be JDBC3 driver for your DB version) and save it at some local library path (e.g. {WAS_HOME}/lib)</li>
<li>Insert the path and jar file name in the next dialog, click &#8220;next&#8221; and &#8220;finish&#8221; afterwards</li>
<li>Navigate to &#8220;Resources -> JDBC -> Data sources&#8221;</li>
<li>Again select the right scope and click &#8220;new&#8221;</li>
<li>Provide a Data source and a jndi name (e.g. jdbc/myPGdb)</li>
<li>On step 2 dialog select your already created JDBC provider</li>
<li>Just leave step 3 at default values and finish creation, that&#8217;s it!</li>
</ol>
<p>Tested on Websphere Application Server 6.1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thapole.net/coding/java/2006/10/12/integrate-postgresql-data-source-in-websphere-application-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>J2EE Development with Rational Application Developer</title>
		<link>http://www.thapole.net/coding/java/2006/09/29/j2ee-development-with-rational-application-developer/</link>
		<comments>http://www.thapole.net/coding/java/2006/09/29/j2ee-development-with-rational-application-developer/#comments</comments>
		<pubDate>Thu, 28 Sep 2006 22:12:43 +0000</pubDate>
		<dc:creator>Thapole</dc:creator>
				<category><![CDATA[Java]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.thapole.net/coding/java/2006/10/12/j2ee-development-with-rational-application-developer/</guid>
		<description><![CDATA[As I have to develop a serious application during my thesis first time ever with Rational Application Developer I was seraching for a good introduction on how to use this mighty tool. I found it, who yould have thought, in an IBM redbook. &#8220;Rational Application Developer V6 Programming Guide&#8221; is an awesome entrance into the [...]]]></description>
			<content:encoded><![CDATA[<p>As I have to develop a serious application during my thesis first time ever with Rational Application Developer I was seraching for a good introduction on how to use this mighty tool. I found it, who yould have thought, in an IBM redbook. &#8220;<a href="http://www.redbooks.ibm.com/abstracts/sg246449.html?Open">Rational Application Developer V6 Programming Guide</a>&#8221; is an awesome entrance into the RAD world. Abutted on the classical SUN J2EE tutorial this book describes in detail how to realise a sample banking application with RAD and Websphere Application Server. It covers the realisation of JSP and Servlet-, JSF and SDO-, even Struts based Dynamic Web Application and the integration of EJB Business logic using integrated UML- and other Data modelling tools.<br />
A must read for any person who thinks Eclipse is too much code work <img src='http://www.thapole.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thapole.net/coding/java/2006/09/29/j2ee-development-with-rational-application-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Instant Messenger</title>
		<link>http://www.thapole.net/coding/java/2006/05/19/java-instant-messenger/</link>
		<comments>http://www.thapole.net/coding/java/2006/05/19/java-instant-messenger/#comments</comments>
		<pubDate>Fri, 19 May 2006 16:43:10 +0000</pubDate>
		<dc:creator>Thapole</dc:creator>
				<category><![CDATA[Java]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.thapole.net/?p=19</guid>
		<description><![CDATA[After some time here&#8217;s another code example. I had to write a Java based Instant Messenger for university. The code demonstrates the usage of object serialisation mechanisms in Java and sending streams via TCP and UDP. Features included are Unicast based chatting, Multicast based Chatting and File Transfer via TCP. As it&#8217;s just a proof [...]]]></description>
			<content:encoded><![CDATA[<p>After some time here&#8217;s another code example. I had to write a Java based Instant Messenger for university. The code demonstrates the usage of object serialisation mechanisms in Java and sending streams via TCP and UDP. Features included are Unicast based chatting, Multicast based Chatting and File Transfer via TCP. As it&#8217;s just a proof of concept there might be some minur issues when running it and as there was a deadline there are some &#8220;unaesthetic&#8221; code parts (don&#8217;t look at the GUI part, I had to adapt that from my professor <img src='http://www.thapole.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) but the main concepts should be pointed out quite ok. Especially the file transfer via TCP migth be interesting because most of the tutorials one can find just handle Strings or something else.<br />
The complete eclispe project can be found <a href="http://www.thapole.net/wp-content/fhf_np_ss06_02.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thapole.net/coding/java/2006/05/19/java-instant-messenger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JDBC and DOM Parser example</title>
		<link>http://www.thapole.net/coding/java/2005/10/14/jdbc-and-dom-parser-example/</link>
		<comments>http://www.thapole.net/coding/java/2005/10/14/jdbc-and-dom-parser-example/#comments</comments>
		<pubDate>Thu, 13 Oct 2005 22:57:25 +0000</pubDate>
		<dc:creator>Thapole</dc:creator>
				<category><![CDATA[Java]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.thapole.net/?p=16</guid>
		<description><![CDATA[A small code snippet for generating XML files out of database data.]]></description>
			<content:encoded><![CDATA[<p>The following code snippet demostrates how Java can be used to read database tables and generate a valid xml file out of it. The example uses a DB2 database but should be ported to other databases with small effort. the data is provied by the sample database provided by DB2. Used techniques are JDBC and DOM Parser.<br />
<code><br />
import java.io.FileOutputStream;<br />
import java.sql.*;<br />
import org.apache.crimson.tree.XmlDocument;<br />
import org.w3c.dom.*;<br />
</code></p>
<p><code><br />
public class DB2Mitarbeiter {<br />
</code></p>
<p><code><br />
	public static void main(String[] args) {<br />
		String url = "jdbc:db2://127.0.0.1:50000/SAMPLE";<br />
		String SQLString=null;<br />
		String lastDep = null;<br />
		Element emp = null;<br />
		Node lastname, firstname = null;<br />
		XmlDocument document = new XmlDocument();<br />
		Element dep = document.createElement("department");<br />
		Node company = document.createElement("company");<br />
		ResultSet rs = null;<br />
		// Load Type4 DB Driver<br />
		try {<br />
			Class.forName("com.ibm.db2.jcc.DB2Driver");<br />
		} catch (ClassNotFoundException e) {<br />
			System.out.println("ClassNotFoundException");<br />
			e.printStackTrace();<br />
		}<br />
		System.out.println("DB Type 4 Driver loaded.");<br />
		// DB connect with url,login and pass<br />
		try {<br />
			FileOutputStream fo = new FileOutputStream("test.xml");<br />
			Connection con = DriverManager.getConnection(url,"username","password");<br />
			Statement stmt = con.createStatement();<br />
			System.out.println("DB connection established.");<br />
			SQLString = "SELECT * FROM DEPARTMENT,EMPLOYEE WHERE EMPLOYEE.WORKDEPT = DEPARTMENT.DEPTNO order by DEPARTMENT.DEPTNO";<br />
			//SQLString = "SELECT * FROM DEPARTMENT LEFT JOIN EMPLOYEE ON EMPLOYEE.WORKDEPT = DEPARTMENT.DEPTNO";<br />
			rs = stmt.executeQuery(SQLString);<br />
			while(rs.next()){<br />
				//System.out.println("rs: " + rs.getString("DEPTNO") + " - lastdep: " + lastDep);<br />
				if (lastDep == null) {<br />
					dep.setAttribute("depid",rs.getString("DEPTNO"));<br />
					lastDep = rs.getString("DEPTNO");<br />
					emp = document.createElement("employee");<br />
					emp.setAttribute("empid", rs.getString("EMPNO"));<br />
					lastname = emp.appendChild(document.createElement("lastname"));<br />
					lastname.appendChild(document.createTextNode(rs.getString("LASTNAME")));<br />
					firstname = emp.appendChild(document.createElement("firstname"));<br />
					firstname.appendChild(document.createTextNode(rs.getString("FIRSTNME")));<br />
					dep.appendChild(emp);<br />
				}<br />
				else if (lastDep.equals(rs.getString("DEPTNO"))) {<br />
					emp = document.createElement("employee");<br />
					emp.setAttribute("empid", rs.getString("EMPNO"));<br />
					lastname = emp.appendChild(document.createElement("lastname"));<br />
					lastname.appendChild(document.createTextNode(rs.getString("LASTNAME")));<br />
					firstname = emp.appendChild(document.createElement("firstname"));<br />
					firstname.appendChild(document.createTextNode(rs.getString("FIRSTNME")));<br />
					dep.appendChild(emp);<br />
				}<br />
				else {<br />
					company.appendChild(dep);<br />
					dep = document.createElement("department");<br />
					dep.setAttribute("depid",rs.getString("DEPTNO"));<br />
					emp = document.createElement("employee");<br />
					emp.setAttribute("empid", rs.getString("EMPNO"));<br />
					lastname = emp.appendChild(document.createElement("lastname"));<br />
					lastname.appendChild(document.createTextNode(rs.getString("LASTNAME")));<br />
					firstname = emp.appendChild(document.createElement("firstname"));<br />
					firstname.appendChild(document.createTextNode(rs.getString("FIRSTNME")));<br />
					dep.appendChild(emp);<br />
				}<br />
				lastDep = rs.getString("DEPTNO");<br />
			}<br />
		document.appendChild(company);<br />
	    document.write(fo);<br />
		fo.close();<br />
		} catch (Exception e1) {<br />
			System.out.println("Fehler");<br />
			e1.printStackTrace();<br />
		}<br />
	}<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thapole.net/coding/java/2005/10/14/jdbc-and-dom-parser-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
