<?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>The World Of Gavin &#187; db2</title>
	<atom:link href="http://www.gavinwillingham.com/tag/db2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gavinwillingham.com</link>
	<description>My opinions on things I have opinions on</description>
	<lastBuildDate>Fri, 04 Jun 2010 14:23:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DB2 Error Codes</title>
		<link>http://www.gavinwillingham.com/db2-error-codes.html</link>
		<comments>http://www.gavinwillingham.com/db2-error-codes.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 13:19:55 +0000</pubDate>
		<dc:creator>gavin</dc:creator>
				<category><![CDATA[Content]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[db2javit]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[sqlcode]]></category>
		<category><![CDATA[sqlstate]]></category>

		<guid isPermaLink="false">http://www.gavinwillingham.com/?p=91</guid>
		<description><![CDATA[Errors when running Control Centre
If you encounter an error dialog stating db2javit : rc - 9505 when starting the control centre, it&#8217;s possible you&#8217;re running Windows Vista/Windows 7. If so, this might be a permissions problem.
Run the control centre as administrator, by right-clicking the icon and selecting Run as administrator
SQL errors



SQLCODE
SQLSTATE
Cause


-7
42601
Special characters, e.g. \n or [...]]]></description>
			<content:encoded><![CDATA[<h2>Errors when running Control Centre</h2>
<p>If you encounter an error dialog stating <code>db2javit : rc - 9505</code> when starting the control centre, it&#8217;s possible you&#8217;re running Windows Vista/Windows 7. If so, this might be a permissions problem.</p>
<p>Run the control centre as administrator, by right-clicking the icon and selecting <code>Run as administrator</code></p>
<h2>SQL errors</h2>
<table border="0">
<tbody>
<tr>
<th>SQLCODE</th>
<th>SQLSTATE</th>
<th>Cause</th>
</tr>
<tr>
<td>-7</td>
<td>42601</td>
<td>Special characters, e.g. <code>\n</code> or <code>&amp;</code> in SQL</td>
</tr>
<tr>
<td>-180</td>
<td>22007</td>
<td>Date/Time/Timestamp in invalid format</td>
</tr>
<tr>
<td>-104</td>
<td>42601</td>
<td>I had this when a field was missing a value, e.g <code>field=</code></td>
</tr>
<tr>
<td>-204</td>
<td>42704</td>
<td>Invalid table name</td>
</tr>
<tr>
<td>-206</td>
<td>42703</td>
<td>Invalid field name</td>
</tr>
<tr>
<td>-408</td>
<td>42821</td>
<td>Bad use of quotes in <code>field=</code>. E.g <code>field='1'</code> for integer (example of <strong>incorrect</strong> style.</td>
</tr>
<tr>
<td>-530</td>
<td>23503</td>
<td>Broken specified constraint. The constraint will probably have an entirely unrecognisable name, such as <code>DB2ADMIN.VISIT.CC1253444571125</code>. I got this error when I had a foreign key, and tried to insert a row with a value that wasn&#8217;t in the foreign table.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.gavinwillingham.com/db2-error-codes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2</title>
		<link>http://www.gavinwillingham.com/db2.html</link>
		<comments>http://www.gavinwillingham.com/db2.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 12:24:54 +0000</pubDate>
		<dc:creator>gavin</dc:creator>
				<category><![CDATA[Content]]></category>
		<category><![CDATA[db2]]></category>

		<guid isPermaLink="false">http://www.gavinwillingham.com/?p=83</guid>
		<description><![CDATA[Pages by me

DB2 and JDBC
DB2 error codes

Useful links



Link
Applies to version


DB2 9 InfoCenter page on datatypes
9, at least



]]></description>
			<content:encoded><![CDATA[<h2>Pages by me</h2>
<ul>
<li><a title="DB2 and JDBC" href="db2-and-jdbc.html">DB2 and JDBC</a></li>
<li><a title="DB2 error codes" href="db2-error-codes.html">DB2 error codes</a></li>
</ul>
<h2>Useful links</h2>
<table border="0">
<tbody>
<tr>
<th>Link</th>
<th>Applies to version</th>
</tr>
<tr>
<td><a title="DB2 InfoCenter page on datatypes" href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/nav/2_9_2_3_0">DB2 9 InfoCenter page on datatypes</a></td>
<td>9, at least</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.gavinwillingham.com/db2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 and JDBC</title>
		<link>http://www.gavinwillingham.com/db2-and-jdbc.html</link>
		<comments>http://www.gavinwillingham.com/db2-and-jdbc.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 12:07:49 +0000</pubDate>
		<dc:creator>gavin</dc:creator>
				<category><![CDATA[Content]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdbc]]></category>

		<guid isPermaLink="false">http://www.gavinwillingham.com/?p=79</guid>
		<description><![CDATA[You need to include

db2jcc.jar
db2jcc_license_cu.jar

on the classpath of the application. These can be found in the java/ sub-directory of the db2 install directory (Program Files/IBM/SQLLIB for me on Windows).
Connecting
The connection server string depends on whether you are using type2 or type4.


Type 1: JDBC-ODBC Bridge
Type 2: Native-API/partly Java driver
Type 3: Net-protocol/all-Java driver
Type 4: Native-protocol/all-Java driver

Source: http://www.javaworld.com/javaworld/jw-07-2000/jw-0707-jdbc.html
Type2:
jdbc:db2:database
Type4:
jdbc:db2//server[:port]/database
Sample code
Opens [...]]]></description>
			<content:encoded><![CDATA[<p>You need to include</p>
<ul>
<li>db2jcc.jar</li>
<li>db2jcc_license_cu.jar</li>
</ul>
<p>on the classpath of the application. These can be found in the <code>java/</code> sub-directory of the db2 install directory (<code>Program Files/IBM/SQLLIB</code> for me on Windows).</p>
<h2>Connecting</h2>
<p>The connection server string depends on whether you are using type2 or type4.</p>
<blockquote>
<ul>
<li>Type 1: JDBC-ODBC Bridge</li>
<li>Type 2: Native-API/partly Java driver</li>
<li>Type 3: Net-protocol/all-Java driver</li>
<li>Type 4: Native-protocol/all-Java driver</li>
</ul>
<p><span class="citation">Source: http://www.javaworld.com/javaworld/jw-07-2000/jw-0707-jdbc.html</span></p></blockquote>
<h3>Type2:</h3>
<p><code>jdbc:db2:database</code></p>
<h3>Type4:</h3>
<p><code>jdbc:db2//server[:port]/database</code></p>
<h3>Sample code</h3>
<p>Opens a connection, executes a query and then closes the connection.<br />
<code></p>
<pre>
/* Load the driver */
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();

/* open the connection */
Connection conn = DriverManager.getConnection(url, user, password);

Statement st = conn.createStatement();

/* Execute a simple query to test the connection */
ResultSet rs = st.executeQuery("SELECT COUNT(*) FROM myTable");
rs.next();

/* Print the query results */
System.out.println(rs.getInt(1));

/* don't forget to close the connection */
conn.close();</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavinwillingham.com/db2-and-jdbc.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
