<?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>indiWiz.com &#187; database</title>
	<atom:link href="http://indiwiz.com/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiwiz.com</link>
	<description>Subhash&#039;s Tech Log</description>
	<lastBuildDate>Sun, 29 Apr 2012 15:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Playing with Neo4J: Sample cli-blog application</title>
		<link>http://indiwiz.com/2010/01/12/playing-with-neo4j-sample-cli-blog-application/</link>
		<comments>http://indiwiz.com/2010/01/12/playing-with-neo4j-sample-cli-blog-application/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 12:24:15 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[neo4j]]></category>
		<category><![CDATA[nosql]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=607</guid>
		<description><![CDATA[Last few days I have been playing with various NoSQL databases. One DB which attracted me because of its beautiful API is Neo4J. To test out it&#8217;s API, I created a sample cli-blog application. People interested in the source code can get it here: http://code.google.com/p/subwiz/source/checkout.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Last few days I have been playing with various <a href="http://en.wikipedia.org/wiki/NoSQL">NoSQL</a> databases. One DB which attracted me because of its beautiful API is <a href="http://neo4j.org/">Neo4J</a>. To test out it&#8217;s API, I created a sample cli-blog application. People interested in the source code can get it here: <a href="http://code.google.com/p/subwiz/source/checkout">http://code.google.com/p/subwiz/source/checkout</a>.</p>
<div class="shr-publisher-607"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2010/01/12/playing-with-neo4j-sample-cli-blog-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Playing with CouchDB</title>
		<link>http://indiwiz.com/2009/04/13/playing-with-couchdb/</link>
		<comments>http://indiwiz.com/2009/04/13/playing-with-couchdb/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 17:11:45 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[dms]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=241</guid>
		<description><![CDATA[I have been playing with CouchDB recently. It is a Document store: As can be seen in the above screenshot, we can store any number of attributes (key-value pairs) for the document. And one document may have any number of attachments. CouchDB provides RESTful-JSON API to access and download documents: CouchDB is written in Erlang.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I have been playing with <a href="http://couchdb.apache.org/">CouchDB</a> recently. It is a Document store:</p>
<p><a href="http://www.flickr.com/photos/subwiz/3438899938/" title="CouchDB Documents by subWiz, on Flickr"><img src="http://farm4.static.flickr.com/3593/3438899938_85635389ea.jpg" width="500" height="394" alt="CouchDB Documents" /></a></p>
<p>As can be seen in the above screenshot, we can store any number of attributes (key-value pairs) for the document. And one document may have any number of attachments.</p>
<p>CouchDB provides RESTful-JSON API to access and download documents:</p>
<p><a href="http://www.flickr.com/photos/subwiz/3438900498/" title="CouchDB JSON Representation by subWiz, on Flickr"><img src="http://farm4.static.flickr.com/3365/3438900498_51b162e776.jpg" width="500" height="394" alt="CouchDB JSON Representation" /></a></p>
<p><a href="http://www.flickr.com/photos/subwiz/3438087141/" title="CouchDB JSON Representation by subWiz, on Flickr"><img src="http://farm4.static.flickr.com/3365/3438087141_8c60dc1b74.jpg" width="388" height="500" alt="CouchDB JSON Representation" /></a></p>
<p>CouchDB is written in <a href="http://erlang.org/">Erlang</a>.</p>
<div class="shr-publisher-241"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/04/13/playing-with-couchdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing Hibernate Code With Derby</title>
		<link>http://indiwiz.com/2009/01/05/unit-testing-hibernate-code-with-derby/</link>
		<comments>http://indiwiz.com/2009/01/05/unit-testing-hibernate-code-with-derby/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 14:40:14 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[derby]]></category>
		<category><![CDATA[hibernate]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=138</guid>
		<description><![CDATA[We faced a scenario which I have faced before: our application uses Hibernate and Oracle Database. And every time we run tests, we had to configure the database specific to that system. I was fed up by this, and explored the possibility of running our code against a test DB. We finalized on Derby. So [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>We faced a scenario which I have faced before: our application uses Hibernate and Oracle Database. And every time we run tests, we had to configure the database specific to that system. I was fed up by this, and explored the possibility of running our code against a test DB. We finalized on <a href="http://db.apache.org/derby/">Derby</a>.</p>
<p>So the next step was configuring <tt>hibernate.cfg.xml</tt>. We did this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;hibernate-configuration&gt;
    &lt;session-factory&gt;
        &lt;property name=&quot;hibernate.connection.driver_class&quot;&gt;org.apache.derby.jdbc.EmbeddedDriver&lt;/property&gt;
        &lt;property name=&quot;hibernate.connection.url&quot;&gt;jdbc:derby:target/testdb;create=true&lt;/property&gt;
        &lt;property name=&quot;show_sql&quot;&gt;true&lt;/property&gt;
        &lt;property name=&quot;dialect&quot;&gt;org.hibernate.dialect.DerbyDialect&lt;/property&gt;
        &lt;property name=&quot;hbm2ddl.auto&quot;&gt;create-drop&lt;/property&gt;
    &lt;/session-factory&gt;
&lt;/hibernate-configuration&gt;
</pre>
<p>In the <tt>hibernate.connection.url</tt> property note the parameter <i>create=true</i>. This ensures when the JDBC layer establishes the connection, the Database will be created if it has not been created earlier. Another important parameter from testing perspective is: <tt>hbm2ddl.auto</tt>. The value set in this parameter is <i>create-drop</i>. This ensures if the tables that are mapped in *.hbm.xml files are not present in the Database, they will be created (during the creation of SessionFactory). And when the SessionFactory is closed, the tables will be dropped. Perfect for testing! Note that, if you want the database tables to persist, just give <i>create</i> instead of <i>create-drop</i>.</p>
<p>So where will the DB be created? This is specified in the <tt>hibernate.connection.url</tt> property. Note the string <i>target/testdb</i>. This is the folder where the DB will be created. Ensure that the relative folder <tt>target/</tt> exists in this case (<tt>testdb</tt> will be automatically created because of the property <tt>create=true</tt>).</p>
<p>In some scenarios we might want to test the correctness of the application by manually verifying the database content. In such situation, as discussed previously, change the <tt>hbm2ddl.auto</tt> property to <i>create</i>. After that connect to that DB using the Derby command-line tool:</p>
<pre>
$ java -cp $JAVA_HOME/db/lib/derby.jar:$JAVA_HOME/db/lib/derbytools.jar \
   org.apache.derby.tools.ij
</pre>
<p>This will open the <tt>ij</tt> prompt. Connect to our DB using it:</p>
<pre>
ij&gt; connect 'jdbc:derby:target/testdb';
ij&gt; select * from __table__;
</pre>
<p>Isn&#8217;t it cool?</p>
<div class="shr-publisher-138"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/01/05/unit-testing-hibernate-code-with-derby/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

